Pass DataFlowInfo through when-conditions

This commit is contained in:
Alexander Udalov
2012-06-21 21:17:13 +04:00
parent 1ae1f13821
commit 38fc57ae42
4 changed files with 11 additions and 7 deletions
@@ -11,7 +11,7 @@ fun foo() {
}
when (x) {
0 -> { if (x == null) return }
0 -> { if (<!SENSELESS_COMPARISON!>x == null<!>) return }
else -> { if (x == null) return }
}
bar(x)
@@ -1,7 +1,7 @@
fun set(<!UNUSED_PARAMETER!>key<!> : String, <!UNUSED_PARAMETER!>value<!> : String) {
val a : String? = ""
when (a) {
"" -> a<!UNSAFE_CALL!>.<!>get(0)
"" -> a.get(0)
is String, is Any -> a.compareTo("")
else -> a.toString()
}