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.
9 lines
214 B
Kotlin
Vendored
9 lines
214 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
|
|
fun calc(x: List<String>?, y: Int?): Int {
|
|
x?.get(y!! - 1)
|
|
// y!! above should not provide smart cast here
|
|
val yy: Int = <!TYPE_MISMATCH!>y<!>
|
|
return yy + (x?.size ?: 0)
|
|
}
|