Add CLI test for -Xnullability-annotations
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
public class A {
|
||||
public class B {
|
||||
public void foo(@org.checkerframework.checker.nullness.compatqual.NonNullDecl String x) {}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
compiler/testData/cli/jvm/compatqualUsage.kt:2:11: error: null can not be a value of a non-null type String
|
||||
a.foo(null)
|
||||
b.foo(null)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
compiler/testData/cli/jvm/compatqualUsage.kt:2:11: error: null can not be a value of a non-null type String
|
||||
a.foo(null)
|
||||
b.foo(null)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
fun bar(a: A) {
|
||||
a.foo(null)
|
||||
fun bar(b: B) {
|
||||
b.foo(null)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
-Xnullability-annotations=@org.jspecify.nullness\:strict
|
||||
-Xnullability-annotations=@org.checkerframework.checker.nullness.compatqual\:warn
|
||||
$TESTDATA_DIR$/severalAnnotations.kt
|
||||
$TESTDATA_DIR$/jspecify
|
||||
$TESTDATA_DIR$/compatqual
|
||||
$FOREIGN_ANNOTATIONS_DIR$
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +1,4 @@
|
||||
compiler/testData/cli/jvm/severalAnnotations.kt:2:11: error: null can not be a value of a non-null type String
|
||||
a.foo(null)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -0,0 +1,5 @@
|
||||
fun bar(a: A, b: B) {
|
||||
a.foo(null)
|
||||
a.bar().hashCode()
|
||||
b.foo(null)
|
||||
}
|
||||
Reference in New Issue
Block a user