-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FE 1.0] Fix false-negative INVALID_IF_AS_EXPRESSION_WARNING and NO_E…
…LSE_IN_WHEN_WARNING ^KT-51711 Fixed
- Loading branch information
1 parent
26b4c94
commit 0c80614
Showing
7 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...vel/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...s/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...rg/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
compiler/testData/diagnostics/tests/controlStructures/kt51711.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// FIR_IDENTICAL | ||
// LANGUAGE: -ProhibitNonExhaustiveIfInRhsOfElvis | ||
// ISSUE: KT-51711 | ||
// WITH_STDLIB | ||
|
||
private fun fake(a: String?) {} | ||
|
||
fun test_1(x: String?, y: String?) { | ||
while (true) { | ||
x ?: if (y == null) break else fake(y) | ||
} | ||
} | ||
|
||
|
||
fun test_2(x: String?, y: String?) { | ||
while (true) { | ||
x ?: when { | ||
true -> break | ||
else -> y?.filter { it.isLowerCase() } | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
compiler/testData/diagnostics/tests/controlStructures/kt51711.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package | ||
|
||
private fun fake(/*0*/ a: kotlin.String?): kotlin.Unit | ||
public fun test_1(/*0*/ x: kotlin.String?, /*1*/ y: kotlin.String?): kotlin.Unit | ||
public fun test_2(/*0*/ x: kotlin.String?, /*1*/ y: kotlin.String?): kotlin.Unit |
6 changes: 6 additions & 0 deletions
6
...tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.