bcc8802014
Expression will be checked against expected type later. Theoretically, this is not very good, but it aligns with the old inference, plus it helps avoiding multiple type mismatch diagnostics.
13 lines
188 B
Kotlin
Vendored
13 lines
188 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
class A
|
|
|
|
fun test(a: Any) {
|
|
var q: String? = null
|
|
|
|
when (a) {
|
|
is A -> q = "1"
|
|
}
|
|
// When is not exhaustive
|
|
return <!TYPE_MISMATCH!>q<!>
|
|
}
|