f702417655
It's enough to have at least one good constraint. Note that the whole algorithm can be a bit more general: we could check also Out<T>, In<T> and verify that T has good only lower constraint or upper constraint, but there are questions for types like Inv<Out<T>>, where T should have lower and upper constraints #KT-31514 Fixed
10 lines
196 B
Kotlin
Vendored
10 lines
196 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
val test: Int = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH!>if (true) {
|
|
when (2) {
|
|
1 -> 1
|
|
else -> <!OI;NULL_FOR_NONNULL_TYPE!>null<!>
|
|
}
|
|
}
|
|
else {
|
|
2
|
|
}<!> |