NI: use the inferred type to check of nullable array for vararg
^KT-40555 Fixed
This commit is contained in:
+15
@@ -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(*(select(arrayOf(""), null))) // no compilation errors before the fix, NPE
|
||||
}
|
||||
Reference in New Issue
Block a user