Control-Flow Analysis: Reuse pseudo-value information for unused expression analysis

This commit is contained in:
Alexey Sedunov
2014-07-25 14:52:15 +04:00
parent 2a19016d58
commit 9cbcabffa4
55 changed files with 239 additions and 190 deletions
@@ -6,5 +6,5 @@ fun Any.equals(other : Any?) : Boolean = this === other
fun main(args: Array<String>) {
val command = parse("")
if (command == null) 1 // error on this line, but must be OK
}
if (command == null) <!UNUSED_EXPRESSION!>1<!> // error on this line, but must be OK
}
@@ -1,3 +1,4 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION
fun <T> T.mustBe(t : T) {
<!UNUSED_EXPRESSION!>"$this must be$<!SYNTAX!>as<!>$t"<!>
}
"$this must be$<!SYNTAX!>as<!>$t"
}