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
353 B
Kotlin
Vendored
13 lines
353 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
//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 <!UNUSED_VARIABLE!>i<!> : Int = <!TYPE_MISMATCH!>intArray[0]<!>
|
|
requiresInt(<!TYPE_MISMATCH!>intArray[0]<!>)
|
|
}
|
|
|
|
fun requiresInt(<!UNUSED_PARAMETER!>i<!>: Int) {}
|