Fold initializer & if to elvis: search for variable usage inside if first #KT-14889 Fixed
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
interface A {
|
||||
val s: String
|
||||
}
|
||||
|
||||
fun foo() = Any()
|
||||
|
||||
fun test(): String {
|
||||
val y = foo()
|
||||
<caret>if (y !is A) return y.toString()
|
||||
return y.s
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
interface A {
|
||||
val s: String
|
||||
}
|
||||
|
||||
fun foo() = Any()
|
||||
|
||||
fun test(): String {
|
||||
val y = foo()
|
||||
<caret>if (y !is A) return "Expected A: $y"
|
||||
return y.s
|
||||
}
|
||||
Reference in New Issue
Block a user