NI: use the inferred type to check of nullable array for vararg

^KT-40555 Fixed
This commit is contained in:
Victor Petukhov
2020-07-27 13:03:45 +03:00
parent 9d63412b3e
commit cca64b8fab
7 changed files with 72 additions and 5 deletions
@@ -0,0 +1,15 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: Test.java
public class Test {
static public void foo(String ... x) {
}
}
// FILE: test.kt
fun <T> select(vararg x: T) = x[1]
fun main(x: Array<String>?) {
Test.foo(<!SPREAD_OF_NULLABLE!>*<!>(select(arrayOf(""), null))) // no compilation errors before the fix, NPE
}