mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Rework jspecify tests
1) Add Java use sites which are similar to Kotlin use sites; 2) Use the new test format: separated Java and Kotlin sources (Java declarations + use sites and Kotlin corresponding use sites), Java declarations + use sites will be a sharable test suite; 3) Remove any dependencies from Java sources except `Object` and jspecify annotations; 4) Introduce a new test runner which compiles Java and Kotlin sources together and dumps all descriptors.
This commit is contained in:
22
compiler/testData/foreignAnnotationsJava8/tests/jspecify/java/IgnoreAnnotations.java
vendored
Normal file
22
compiler/testData/foreignAnnotationsJava8/tests/jspecify/java/IgnoreAnnotations.java
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import org.jspecify.annotations.*;
|
||||
|
||||
public class IgnoreAnnotations {
|
||||
public static class Base {
|
||||
void foo() {}
|
||||
}
|
||||
public static class Derived extends Base { }
|
||||
|
||||
@Nullable public Derived field = null;
|
||||
|
||||
@Nullable
|
||||
public Derived foo(Derived x, @NullnessUnspecified Base y) {
|
||||
return null;
|
||||
}
|
||||
|
||||
static void main(IgnoreAnnotations a) {
|
||||
a.foo(new Derived(), null).foo();
|
||||
a.foo(null, new Derived()).foo();
|
||||
|
||||
a.field.foo();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user