Support empty if-statements

Type-check "if (...) ;" to Unit, report "implicit cast to Unit", propagate data
flow info out of its condition

 #KT-2478 Fixed
This commit is contained in:
Alexander Udalov
2013-12-02 20:30:55 +04:00
parent f045a06dee
commit 4cd4026174
7 changed files with 72 additions and 8 deletions
@@ -0,0 +1,12 @@
fun box(): String {
if (true);
if (false);
val iftrue = if (true);
val iffalse = if (false);
var state = 0
val k = if (state++==1);
if (state != 1) return "Fail: $state"
return "OK"
}