Error on 'if' without an 'else' branch when used as an expression

This commit is contained in:
Yan Zhulanow
2015-10-13 18:13:51 +03:00
parent de5dc61820
commit e14c9645dc
29 changed files with 121 additions and 91 deletions
@@ -4,13 +4,13 @@ fun test() {
if (false);
if (true);
val x = <!IMPLICIT_CAST_TO_UNIT_OR_ANY!>if (false)<!>;
val x = <!INVALID_IF_AS_EXPRESSION!>if (false)<!>;
foo(x)
val y: Unit = if (false);
val y: Unit = <!INVALID_IF_AS_EXPRESSION!>if (false)<!>;
foo(y)
foo({if (1==1);}())
return if (true);
return <!INVALID_IF_AS_EXPRESSION!>if (true)<!>;
}