Fold initializer & if to elvis: search for variable usage inside if first #KT-14889 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-12-20 17:44:26 +03:00
parent ee1b741e84
commit 67788e39d3
4 changed files with 51 additions and 13 deletions
@@ -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
}