Files
kotlin-fork/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt
T
2017-11-29 02:54:26 +03:00

18 lines
514 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
val test1 = { when (true) { true -> <!OI;IMPLICIT_CAST_TO_ANY!>1<!>; else -> <!OI;IMPLICIT_CAST_TO_ANY!>""<!> } }
val test2 = { { when (true) { true -> <!OI;IMPLICIT_CAST_TO_ANY!>1<!>; else -> <!OI;IMPLICIT_CAST_TO_ANY!>""<!> } } }
val test3: (Boolean) -> Any = { when (true) { true -> 1; else -> "" } }
val test4: (Boolean) -> Any? = { when (true) { true -> 1; else -> "" } }
fun println() {}
val test5 = {
when (true) {
true -> println()
else -> println()
}
}