Add -Xsupport-compatqual-checker-framework-annotations flag
It's implemented through Jsr305State while it's not related to jsr-305 becasue currently it's the most convenient way to introduce the flag. Probably, it's worth renaming Jsr305State to something more abstract like NullabilityAnnotationsConfiguration #KT-21982 Fixed
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
public class A {
|
||||
public void foo(@org.checkerframework.checker.nullness.compatqual.NonNullDecl String x) {}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
$TESTDATA_DIR$/compatqualUsage.kt
|
||||
$TESTDATA_DIR$/compatqual
|
||||
$FOREIGN_ANNOTATIONS_DIR$
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +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)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -0,0 +1,6 @@
|
||||
-Xsupport-compatqual-checker-framework-annotations=disable
|
||||
$TESTDATA_DIR$/compatqualUsage.kt
|
||||
$TESTDATA_DIR$/compatqual
|
||||
$FOREIGN_ANNOTATIONS_DIR$
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,6 @@
|
||||
-Xsupport-compatqual-checker-framework-annotations=enable
|
||||
$TESTDATA_DIR$/compatqualUsage.kt
|
||||
$TESTDATA_DIR$/compatqual
|
||||
$FOREIGN_ANNOTATIONS_DIR$
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +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)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -0,0 +1,3 @@
|
||||
fun bar(a: A) {
|
||||
a.foo(null)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
-Xsupport-compatqual-checker-framework-annotations=true
|
||||
$TESTDATA_DIR$/compatqualUsage.kt
|
||||
$TESTDATA_DIR$/compatqual
|
||||
$FOREIGN_ANNOTATIONS_DIR$
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +1,2 @@
|
||||
error: unrecognized -Xsupport-compatqual-checker-framework-annotations option: true. Possible values are 'enable'/'disable'
|
||||
COMPILATION_ERROR
|
||||
+5
@@ -35,6 +35,11 @@ where advanced options include:
|
||||
-Xskip-runtime-version-check Allow Kotlin runtime libraries of incompatible versions in the classpath
|
||||
-Xstrict-java-nullability-assertions
|
||||
Generate nullability assertions for non-null Java expressions
|
||||
-Xsupport-compatqual-checker-framework-annotations=enable|disable
|
||||
|
||||
Specify behavior for Checker Framework compatqual annotations (NullableDecl/NonNullDecl).
|
||||
Default value is 'enable'
|
||||
|
||||
-Xuse-javac Use javac for Java source and class files analysis
|
||||
-Xuse-old-class-files-reading Use old class files reading implementation (may slow down the build and should be used in case of problems with the new implementation)
|
||||
-Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info
|
||||
|
||||
Reference in New Issue
Block a user