Add CLI test for -Xnullability-annotations

This commit is contained in:
Victor Petukhov
2021-06-11 10:30:10 +03:00
parent b0a44705b4
commit 50ad5116b5
8 changed files with 27 additions and 5 deletions
@@ -1,3 +1,3 @@
public class A {
public class B {
public void foo(@org.checkerframework.checker.nullness.compatqual.NonNullDecl String x) {}
}
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -1,3 +1,3 @@
fun bar(a: A) {
a.foo(null)
fun bar(b: B) {
b.foo(null)
}
+8
View File
@@ -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$
+4
View File
@@ -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
+5
View File
@@ -0,0 +1,5 @@
fun bar(a: A, b: B) {
a.foo(null)
a.bar().hashCode()
b.foo(null)
}