[FE 1.0] Fix false-negative INVALID_IF_AS_EXPRESSION_WARNING and NO_ELSE_IN_WHEN_WARNING
^KT-51711 Fixed
This commit is contained in:
committed by
teamcity
parent
c67c1a69b9
commit
565c61a702
@@ -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() }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user