JPS: implement tracking of null annotations

#KT-12933 fixed
    #KT-14266 fixed
This commit is contained in:
Alexey Tsvetkov
2016-08-29 17:43:40 +03:00
committed by Dmitry Jemerov
parent 6d958eb32b
commit 05f278ce20
27 changed files with 367 additions and 0 deletions
@@ -0,0 +1,7 @@
import org.jetbrains.annotations.Nullable;
class A {
void f(@Nullable String s) {
System.out.println(s);
}
}
@@ -0,0 +1,7 @@
import org.jetbrains.annotations.NotNull;
class A {
void f(@NotNull String s) {
System.out.println(s);
}
}
@@ -0,0 +1,3 @@
internal class AChild : A() {
override fun f(s: String?) {}
}
@@ -0,0 +1,3 @@
internal class AChild : A() {
override fun f(s: String) {}
}
@@ -0,0 +1,47 @@
================ Step #1 =================
Cleaning output files:
out/production/module/A.class
End of files
Exit code: NOTHING_DONE
------------------------------------------
Compiling files:
src/A.java
End of files
Cleaning output files:
out/production/module/AChild.class
out/production/module/META-INF/module.kotlin_module
out/production/module/UseAKt.class
End of files
Compiling files:
src/AChild.kt
src/useA.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
'f' overrides nothing
Null can not be a value of a non-null type String
================ Step #2 =================
Cleaning output files:
out/production/module/A.class
End of files
Compiling files:
src/AChild.kt
src/useA.kt
End of files
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Compiling files:
src/A.java
End of files
Cleaning output files:
out/production/module/Dummy.class
End of files
Compiling files:
src/Dummy.kt
End of files
Exit code: OK
------------------------------------------
@@ -0,0 +1,39 @@
================ Step #1 =================
Cleaning output files:
out/production/module/A.class
End of files
Exit code: NOTHING_DONE
------------------------------------------
Compiling files:
src/A.java
End of files
Cleaning output files:
out/production/module/AChild.class
out/production/module/META-INF/module.kotlin_module
out/production/module/UseAKt.class
End of files
Compiling files:
src/AChild.kt
src/useA.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
'f' overrides nothing
Null can not be a value of a non-null type String
================ Step #2 =================
Cleaning output files:
out/production/module/A.class
End of files
Compiling files:
src/AChild.kt
src/useA.kt
End of files
Exit code: OK
------------------------------------------
Compiling files:
src/A.java
End of files
@@ -0,0 +1,3 @@
fun useA() {
A().f(null)
}
@@ -0,0 +1,3 @@
fun useA() {
A().f("useA")
}