Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/kt10192.kt
T
Dmitry Petrov f34f7556bc KT-10192 got fixed due to new if/when check
(which doesn't depend on the expected type for expression)
 #KT-10192 Fixed
2015-12-01 10:36:40 +03:00

20 lines
344 B
Kotlin
Vendored

fun test1() {
if (true) {
when (true) {
true -> println()
}
} else {
System.out?.println() // kotlin.Unit?
}
}
fun test2() {
val mlist = arrayListOf("")
if (true) {
when (true) {
true -> println()
}
} else {
mlist.add("") // kotlin.Boolean
}
}