4cd4026174
Type-check "if (...) ;" to Unit, report "implicit cast to Unit", propagate data flow info out of its condition #KT-2478 Fixed
17 lines
229 B
Kotlin
17 lines
229 B
Kotlin
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);
|
|
}
|