660c438ebe
This commit includes:
- test runners for foreign annotation tests
- minor changes testdata related to changed directives syntax
- dropping tests with javac integration: old javac tests actually ran
compiler without javac because of bug in configuration, so some
nullability annotations features are not supported in javac mode.
It's fine to drop it since javac mode is not fully supported
by compiler
34 lines
579 B
Java
Vendored
34 lines
579 B
Java
Vendored
import org.jspecify.annotations.*;
|
|
|
|
@DefaultNonNull
|
|
public class Simple {
|
|
@Nullable public Derived field = null;
|
|
|
|
@Nullable
|
|
public Derived foo(Derived x, @NullnessUnspecified Base y) {
|
|
return null;
|
|
}
|
|
|
|
public Derived bar() {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
class Base {}
|
|
class Derived extends Base {
|
|
void foo() {}
|
|
}
|
|
|
|
@DefaultNonNull
|
|
class Use {
|
|
static public void main(Simple a, Derived x) {
|
|
a.foo(x, null).foo();
|
|
// jspecify_nullness_mismatch
|
|
a.foo(null, x).foo();
|
|
|
|
a.bar().foo();
|
|
|
|
a.field.foo();
|
|
}
|
|
}
|