Retaining annotations on Java array types

This commit is contained in:
Andrey Breslav
2015-02-04 19:21:55 +03:00
parent fc3cd20456
commit 1d4109aec1
7 changed files with 78 additions and 23 deletions
@@ -24,11 +24,11 @@ fun test() {
val platformJ = J.staticJ
platformNN[0]
platformN[0]
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0]
platformJ[0]
platformNN[0] = 1
platformN[0] = 1
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0] = 1
platformJ[0] = 1
}
@@ -0,0 +1,34 @@
// FILE: p/J.java
package p;
import org.jetbrains.annotations.*;
public class J {
@NotNull
public static int[] staticNN;
@Nullable
public static int[] staticN;
public static int[] staticJ;
}
// FILE: k.kt
import p.*
fun test() {
// @NotNull platform type
val platformNN = J.staticNN
// @Nullable platform type
val platformN = J.staticN
// platform type with no annotation
val platformJ = J.staticJ
platformNN[0]
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0]
platformJ[0]
platformNN[0] = 1
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0] = 1
platformJ[0] = 1
}
@@ -0,0 +1,3 @@
package
internal fun test(): kotlin.Unit