Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/kt1293.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

12 lines
285 B
Kotlin
Vendored

//KT-1293 Compiler doesn't show error when element of Array<Int?> is assigned to Int
package kt1293
fun main() {
val intArray = arrayOfNulls<Int>(10)
val i : Int = <!TYPE_MISMATCH!>intArray[0]<!>
requiresInt(<!TYPE_MISMATCH!>intArray[0]<!>)
}
fun requiresInt(i: Int) {}