K2/jspecify: reproduce KT-65594

This commit is contained in:
Mikhail Glukhikh
2024-03-14 09:36:11 +01:00
committed by Space Team
parent 30e2af7b66
commit 5b0cb5c9db
10 changed files with 152 additions and 0 deletions
@@ -750,6 +750,12 @@ public class FirPsiOldFrontendForeignAnnotationsCompiledJavaTestGenerated extend
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -850,6 +856,12 @@ public class FirPsiOldFrontendForeignAnnotationsCompiledJavaTestGenerated extend
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -808,6 +808,12 @@ public class FirPsiOldFrontendForeignAnnotationsCompiledJavaWithPsiClassReadingT
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -908,6 +914,12 @@ public class FirPsiOldFrontendForeignAnnotationsCompiledJavaWithPsiClassReadingT
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -808,6 +808,12 @@ public class FirPsiOldFrontendForeignAnnotationsSourceJavaTestGenerated extends
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -908,6 +914,12 @@ public class FirPsiOldFrontendForeignAnnotationsSourceJavaTestGenerated extends
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -0,0 +1,20 @@
// JSPECIFY_STATE: strict
// FILE: Box.java
import org.jspecify.annotations.*;
@NullMarked
public class Box<V extends @Nullable Object> {
public static <V extends @Nullable Object> Box<V> make() {
return new Box<>();
}
}
// FILE: Util.java
public final class Util {
public Box<?> boxId(Box<?> box) { return box; }
}
// FILE: a.kt
fun foo(u: Util) =
u.boxId(Box.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>make<!>())
@@ -0,0 +1,20 @@
// JSPECIFY_STATE: strict
// FILE: Box.java
import org.jspecify.annotations.*;
@NullMarked
public class Box<V extends @Nullable Object> {
public static <V extends @Nullable Object> Box<V> make() {
return new Box<>();
}
}
// FILE: Util.java
public final class Util {
public Box<?> boxId(Box<?> box) { return box; }
}
// FILE: a.kt
fun foo(u: Util) =
u.boxId(Box.make())
@@ -0,0 +1,20 @@
// JSPECIFY_STATE: warn
// FILE: Box.java
import org.jspecify.annotations.*;
@NullMarked
public class Box<V extends @Nullable Object> {
public static <V extends @Nullable Object> Box<V> make() {
return new Box<>();
}
}
// FILE: Util.java
public final class Util {
public Box<?> boxId(Box<?> box) { return box; }
}
// FILE: a.kt
fun foo(u: Util) =
u.boxId(Box.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>make<!>())
@@ -0,0 +1,20 @@
// JSPECIFY_STATE: warn
// FILE: Box.java
import org.jspecify.annotations.*;
@NullMarked
public class Box<V extends @Nullable Object> {
public static <V extends @Nullable Object> Box<V> make() {
return new Box<>();
}
}
// FILE: Util.java
public final class Util {
public Box<?> boxId(Box<?> box) { return box; }
}
// FILE: a.kt
fun foo(u: Util) =
u.boxId(Box.make())
@@ -750,6 +750,12 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -850,6 +856,12 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -808,6 +808,12 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -908,6 +914,12 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -808,6 +808,12 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {
@@ -908,6 +914,12 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt");
}
@Test
@TestMetadata("NullMarkedWithStarType.kt")
public void testNullMarkedWithStarType() {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullMarkedWithStarType.kt");
}
@Test
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() {