Files
kotlin-fork/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/WildcardsWithDefault.java
T
Dmitriy Novozhilov 660c438ebe [Test] Migrate tests of foreign annotations to new infrastructure
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
2020-12-24 14:58:05 +03:00

33 lines
1.2 KiB
Java
Vendored

import org.jspecify.annotations.*;
@DefaultNonNull
public class WildcardsWithDefault {
public void noBoundsNotNull(A<?, ?, ?> a) {}
public void noBoundsNullable(A<@Nullable ?, @Nullable ?, @Nullable ?> a) {}
}
class A <T extends Object, E extends @Nullable Object, F extends @NullnessUnspecified Object> {}
@DefaultNonNull
class Use {
public static void main(
A<Object, Object, Object> aNotNullNotNullNotNull,
A<Object, Object, @Nullable Object> aNotNullNotNullNull,
A<Object, @Nullable Object, Object> aNotNullNullNotNull,
A<Object, @Nullable Object, @Nullable Object> aNotNullNullNull,
WildcardsWithDefault b
) {
// jspecify_nullness_mismatch
b.noBoundsNotNull(aNotNullNotNullNotNull);
b.noBoundsNotNull(aNotNullNotNullNull);
// jspecify_nullness_mismatch
b.noBoundsNotNull(aNotNullNullNotNull);
// jspecify_nullness_mismatch
b.noBoundsNotNull(aNotNullNullNull);
b.noBoundsNullable(aNotNullNotNullNotNull);
b.noBoundsNullable(aNotNullNotNullNull);
b.noBoundsNullable(aNotNullNullNotNull);
b.noBoundsNullable(aNotNullNullNull);
}
}