Files
kotlin-fork/compiler/testData/diagnostics/tests/when/kt9929.kt
T
Pavel Kirpichenkov a9391c8dfb [NI] Remove Nothing result type restriction in most cases
Make Nothing as result type not suitable only for if, when, try and ?: special functions.
2019-12-25 14:59:05 +03:00

10 lines
214 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
val test: Int = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH!>if (true) {
when (2) {
1 -> 1
else -> <!OI;NULL_FOR_NONNULL_TYPE!>null<!>
}
}
else {
2
}<!>