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:
@@ -0,0 +1,16 @@
|
||||
fun foo(x: Unit) = x
|
||||
|
||||
fun test() {
|
||||
if (false);
|
||||
if (true);
|
||||
|
||||
val x = <!IMPLICIT_CAST_TO_UNIT_OR_ANY!>if (false)<!>;
|
||||
foo(x)
|
||||
|
||||
val y: Unit = if (false);
|
||||
foo(y)
|
||||
|
||||
foo({if (1==1);}())
|
||||
|
||||
return if (true);
|
||||
}
|
||||
Reference in New Issue
Block a user