2ecba6ac39
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)
24 lines
522 B
Kotlin
Vendored
24 lines
522 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNSUPPORTED
|
|
|
|
fun test() {
|
|
val a = []
|
|
val b: Array<Int> = []
|
|
val c = [1, 2]
|
|
val d: Array<Int> = [1, 2]
|
|
val e: Array<String> = <!INITIALIZER_TYPE_MISMATCH!>[1]<!>
|
|
|
|
val f: IntArray = [1, 2]
|
|
val g = [f]
|
|
}
|
|
|
|
fun check() {
|
|
[1, 2] checkType { _<Array<Int>>() }
|
|
[""] checkType { _<Array<String>>() }
|
|
|
|
val f: IntArray = [1]
|
|
[f] checkType { _<Array<IntArray>>() }
|
|
|
|
[1, ""] checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Array<Any>>() }
|
|
}
|