From e2e0358505f8be46f003d57bf8ae3fe7d906553f Mon Sep 17 00:00:00 2001 From: pyos Date: Thu, 29 Jul 2021 15:41:49 +0200 Subject: [PATCH] Remove "FIR" foreign annotation tests They do not actually use FIR. --- .../AnnotatedBoundsOfWildcard.fir.kt | 90 ------ .../AnnotatedBoundsOfWildcard.fir.txt | 38 --- .../jspecify/strictMode/Captured.fir.kt | 17 -- .../jspecify/strictMode/Captured.fir.txt | 18 -- .../jspecify/strictMode/Defaults.fir.kt | 51 ---- .../jspecify/strictMode/Defaults.fir.txt | 25 -- .../strictMode/IgnoreAnnotations.fir.kt | 49 ---- .../strictMode/IgnoreAnnotations.fir.txt | 31 --- .../NonPlatformTypeParameter.fir.kt | 30 -- .../NonPlatformTypeParameter.fir.txt | 19 -- .../NullnessUnspecifiedTypeParameter.fir.kt | 36 --- .../NullnessUnspecifiedTypeParameter.fir.txt | 19 -- .../jspecify/strictMode/SelfType.fir.kt | 56 ---- .../jspecify/strictMode/SelfType.fir.txt | 68 ----- .../jspecify/strictMode/Simple.fir.kt | 40 --- .../jspecify/strictMode/Simple.fir.txt | 28 -- .../TypeArgumentsFromParameterBounds.fir.kt | 49 ---- .../TypeArgumentsFromParameterBounds.fir.txt | 33 --- .../strictMode/TypeParameterBounds.fir.kt | 46 ---- .../strictMode/TypeParameterBounds.fir.txt | 28 -- .../strictMode/WildcardsWithDefault.fir.kt | 37 --- .../strictMode/WildcardsWithDefault.fir.txt | 19 -- .../warnMode/AnnotatedBoundsOfWildcard.fir.kt | 89 ------ .../AnnotatedBoundsOfWildcard.fir.txt | 38 --- .../jspecify/warnMode/Captured.fir.kt | 16 -- .../jspecify/warnMode/Captured.fir.txt | 18 -- .../jspecify/warnMode/Defaults.fir.kt | 50 ---- .../jspecify/warnMode/Defaults.fir.txt | 25 -- .../warnMode/IgnoreAnnotations.fir.kt | 48 ---- .../warnMode/IgnoreAnnotations.fir.txt | 31 --- .../warnMode/NonPlatformTypeParameter.fir.kt | 30 -- .../warnMode/NonPlatformTypeParameter.fir.txt | 19 -- .../NullnessUnspecifiedTypeParameter.fir.kt | 36 --- .../NullnessUnspecifiedTypeParameter.fir.txt | 19 -- .../jspecify/warnMode/SelfType.fir.kt | 59 ---- .../jspecify/warnMode/SelfType.fir.txt | 67 ----- .../jspecify/warnMode/Simple.fir.kt | 39 --- .../jspecify/warnMode/Simple.fir.txt | 28 -- .../TypeArgumentsFromParameterBounds.fir.kt | 48 ---- .../TypeArgumentsFromParameterBounds.fir.txt | 33 --- .../warnMode/TypeParameterBounds.fir.kt | 45 --- .../warnMode/TypeParameterBounds.fir.txt | 28 -- .../warnMode/WildcardsWithDefault.fir.kt | 37 --- .../warnMode/WildcardsWithDefault.fir.txt | 19 -- .../misc/annotatedTypeArguments.fir.kt | 38 --- .../misc/annotatedTypeArguments.fir.txt | 48 ---- .../misc/classTypeParameterBound.fir.kt | 25 -- ...classTypeParameterBoundWithWarnings.fir.kt | 25 -- .../enhancedRecursiveStarProjection.fir.kt | 11 - .../misc/methodWithTypeParameter.fir.kt | 54 ---- .../misc/methodWithTypeParameter.fir.txt | 44 --- .../misc/notNullVarargsOverrides.fir.kt | 21 -- .../misc/notNullVarargsOverrides.fir.txt | 26 -- .../misc/nullableVarargsOverrides.fir.kt | 21 -- .../misc/nullableVarargsOverrides.fir.txt | 26 -- .../java8Tests/misc/returnType.fir.kt | 65 ----- .../returnTypeDifferentConstructor.fir.kt | 37 --- .../returnTypeDifferentConstructor.fir.txt | 56 ---- .../misc/returnTypeOverrideInKotlin.fir.kt | 31 --- .../misc/returnTypeOverrideInKotlin.fir.txt | 56 ---- .../misc/returnTypeWithWarnings.fir.kt | 67 ----- .../java8Tests/misc/simple.fir.kt | 7 - .../java8Tests/misc/simple.fir.txt | 9 - .../java8Tests/misc/valueParameter.fir.kt | 62 ----- .../misc/valueParameterWithWarnings.fir.kt | 64 ----- ...nAnnotationsCompiledJavaTestGenerated.java | 258 ++---------------- ...dJavaWithPsiClassReadingTestGenerated.java | 258 ++---------------- ...ignAnnotationsSourceJavaTestGenerated.java | 258 ++---------------- .../generators/GenerateJUnit5CompilerTests.kt | 18 +- 69 files changed, 72 insertions(+), 3162 deletions(-) delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.txt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt deleted file mode 100644 index c8050af3048..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt +++ /dev/null @@ -1,90 +0,0 @@ -// JSPECIFY_STATE: strict -// MUTE_FOR_PSI_CLASS_FILES_READING -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode - -// FILE: AnnotatedBoundsOfWildcard.java -import org.jspecify.nullness.*; - -@NullMarked -public class AnnotatedBoundsOfWildcard { - public void superAsIs(Test a) {} - public void superNotNull(Test a) {} - public void superNullable(Test a) {} - - public void extendsAsIs(Test a) {} - public void extendsNotNull(Test a) {} - public void extendsNullable(Test a) {} - - public void noBounds(Test a) {} -} - -// FILE: Base.java -public class Base {} - -// FILE: Derived.java -public class Derived extends Base {} - -// FILE: Test.java -import org.jspecify.nullness.*; - -@NullMarked -public class Test { } - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: Test, - aNotNullNotNullNull: Test, - aNotNullNullNotNull: Test, - aNotNullNullNull: Test, - - aAnyNotNullNotNullNotNull: Test, - aAnyNotNullNotNullNull: Test, - aAnyNotNullNullNotNull: Test, - aAnyNotNullNullNull: Test, - - b: AnnotatedBoundsOfWildcard -): Unit { - // jspecify_nullness_mismatch - b.superAsIs(aAnyNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.superAsIs(aAnyNotNullNotNullNull) - b.superAsIs(aAnyNotNullNullNotNull) - b.superAsIs(aAnyNotNullNullNull) - - b.superNotNull(aAnyNotNullNotNullNotNull) - b.superNotNull(aAnyNotNullNotNullNull) - b.superNotNull(aAnyNotNullNullNotNull) - b.superNotNull(aAnyNotNullNullNull) - - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNotNullNull) - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNullNotNull) - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNullNull) - - b.extendsAsIs(aNotNullNotNullNotNull) - b.extendsAsIs(aNotNullNotNullNull) - b.extendsAsIs(aNotNullNullNotNull) - b.extendsAsIs(aNotNullNullNull) - - b.extendsNotNull(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNullNull) - - b.extendsNullable(aNotNullNotNullNotNull) - b.extendsNullable(aNotNullNotNullNull) - b.extendsNullable(aNotNullNullNotNull) - b.extendsNullable(aNotNullNullNull) - - b.noBounds(aNotNullNotNullNotNull) - b.noBounds(aNotNullNotNullNull) - b.noBounds(aNotNullNullNotNull) - b.noBounds(aNotNullNullNull) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt deleted file mode 100644 index 0dc4cd5bf45..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt +++ /dev/null @@ -1,38 +0,0 @@ -package - -public fun main(/*0*/ aNotNullNotNullNotNull: Test, /*1*/ aNotNullNotNullNull: Test, /*2*/ aNotNullNullNotNull: Test, /*3*/ aNotNullNullNull: Test, /*4*/ aAnyNotNullNotNullNotNull: Test, /*5*/ aAnyNotNullNotNullNull: Test, /*6*/ aAnyNotNullNullNotNull: Test, /*7*/ aAnyNotNullNullNull: Test, /*8*/ b: AnnotatedBoundsOfWildcard): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class AnnotatedBoundsOfWildcard { - public constructor AnnotatedBoundsOfWildcard() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun extendsAsIs(/*0*/ a: Test): kotlin.Unit - public open fun extendsNotNull(/*0*/ a: Test): kotlin.Unit - public open fun extendsNullable(/*0*/ a: Test): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun noBounds(/*0*/ a: Test): kotlin.Unit - public open fun superAsIs(/*0*/ a: Test): kotlin.Unit - public open fun superNotNull(/*0*/ a: Test): kotlin.Unit - public open fun superNullable(/*0*/ a: Test): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Base { - public constructor Base() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Derived : Base { - public constructor Derived() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.kt deleted file mode 100644 index f99226b806b..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// JSPECIFY_STATE: strict -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode -// FILE: J1.java -import org.jetbrains.annotations.Nullable; - -public interface J1 { - @Nullable - public static T foo(J1 x) { return null; } -} - -// FILE: J2.java -import org.jspecify.nullness.Nullable; - -public interface J2 extends J1 { } - -// FILE: kotlin.kt -private fun J2<*>.bar() = J1.foo(this) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.txt deleted file mode 100644 index a30bd47201f..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.txt +++ /dev/null @@ -1,18 +0,0 @@ -package - -private fun J2<*>.bar(): @org.jspecify.nullness.Nullable kotlin.Any? - -public interface J1 { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - @org.jetbrains.annotations.Nullable public open fun foo(/*0*/ x: J1!): @org.jetbrains.annotations.Nullable T? -} - -public interface J2 : J1 { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt deleted file mode 100644 index fd430d4da9e..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt +++ /dev/null @@ -1,51 +0,0 @@ -// JSPECIFY_STATE: strict -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode - -// FILE: Defaults.java -import org.jspecify.nullness.*; - -@NullMarked -public class Defaults { - public Foo defaultField = null; - @Nullable public Foo field = null; - - public Foo everythingNotNullable(Foo x) { return null; } - - public @Nullable Foo everythingNullable(@Nullable Foo x) { return null; } - - public @NullnessUnspecified Foo everythingUnknown(@NullnessUnspecified Foo x) { return null; } - - public @Nullable Foo mixed(Foo x) { return null; } - - public Foo explicitlyNullnessUnspecified(@NullnessUnspecified Foo x) { return null; } -} - -// FILE: Foo.java -public class Foo { - public Object foo() { return null; } -} - -// FILE: main.kt -fun main(a: Defaults, x: Foo): Unit { - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo() - a.everythingNotNullable(x).foo() - - // jspecify_nullness_mismatch - a.everythingNullable(null).foo() - - a.everythingUnknown(null).foo() - - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a.mixed(null).foo() - // jspecify_nullness_mismatch - a.mixed(x).foo() - - a.explicitlyNullnessUnspecified(x).foo() - a.explicitlyNullnessUnspecified(null).foo() - - a.defaultField.foo() - - // jspecify_nullness_mismatch - a.field.foo() -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt deleted file mode 100644 index b2c18d47bf5..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt +++ /dev/null @@ -1,25 +0,0 @@ -package - -public fun main(/*0*/ a: Defaults, /*1*/ x: Foo): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class Defaults { - public constructor Defaults() - public final var defaultField: Foo - @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Foo? - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun everythingNotNullable(/*0*/ x: Foo): Foo - @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Foo?): @org.jspecify.nullness.Nullable Foo? - @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): @org.jspecify.nullness.NullnessUnspecified Foo! - public open fun explicitlyNullnessUnspecified(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): Foo - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - @org.jspecify.nullness.Nullable public open fun mixed(/*0*/ x: Foo): @org.jspecify.nullness.Nullable Foo? - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Foo { - public constructor Foo() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(): kotlin.Any! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt deleted file mode 100644 index 763fa855a45..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt +++ /dev/null @@ -1,49 +0,0 @@ -// JSPECIFY_STATE: strict -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode - -// FILE: IgnoreAnnotations.java -import org.jspecify.nullness.*; - -@NullMarked -public class IgnoreAnnotations { - @Nullable public Derived field = null; - - @Nullable - public Derived foo(Derived x, @NullnessUnspecified Base y) { - return null; - } - - public Derived everythingNotNullable(Derived x) { return null; } - - public @Nullable Derived everythingNullable(@Nullable Derived x) { return null; } - - public @NullnessUnspecified Derived everythingUnknown(@NullnessUnspecified Derived x) { return null; } -} - -// FILE: Base.java -public class Base { - void foo() {} -} - -// FILE: Derived.java -public class Derived extends Base { } - -// FILE: main.kt -fun main(a: IgnoreAnnotations, x: Derived): Unit { - // jspecify_nullness_mismatch - a.foo(x, null).foo() - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a.foo(null, x).foo() - - // jspecify_nullness_mismatch - a.field.foo() - - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo() - a.everythingNotNullable(x).foo() - - // jspecify_nullness_mismatch - a.everythingNullable(null).foo() - - a.everythingUnknown(null).foo() -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt deleted file mode 100644 index c569b882f62..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt +++ /dev/null @@ -1,31 +0,0 @@ -package - -public fun main(/*0*/ a: IgnoreAnnotations, /*1*/ x: Derived): kotlin.Unit - -public open class Base { - public constructor Base() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open fun foo(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Derived : Base { - public constructor Derived() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class IgnoreAnnotations { - public constructor IgnoreAnnotations() - @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived? - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun everythingNotNullable(/*0*/ x: Derived): Derived - @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Derived?): @org.jspecify.nullness.Nullable Derived? - @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Derived!): @org.jspecify.nullness.NullnessUnspecified Derived! - @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt deleted file mode 100644 index 08bbc182db2..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +TypeEnhancementImprovementsInStrictMode -// JSPECIFY_STATE: strict -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: NonPlatformTypeParameter.java -import org.jspecify.nullness.*; - -public class NonPlatformTypeParameter { - public void foo(T t) {} - public void bar(E e) {} -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { - a1.foo(null) - a1.bar(null) - // jspecify_nullness_mismatch - a1.bar(null) - a1.bar(x) - - // jspecify_nullness_mismatch - a2.foo(null) - a2.bar(null) - // jspecify_nullness_mismatch - a2.bar(null) - a2.bar(x) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt deleted file mode 100644 index ac9d3a20f90..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt +++ /dev/null @@ -1,19 +0,0 @@ -package - -public fun main(/*0*/ a1: NonPlatformTypeParameter, /*1*/ a2: NonPlatformTypeParameter, /*2*/ x: T): kotlin.Unit - -public open class NonPlatformTypeParameter { - public constructor NonPlatformTypeParameter() - public open fun bar(/*0*/ e: E): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt deleted file mode 100644 index 125c8aeea6d..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// JSPECIFY_STATE: strict - -// FILE: NullnessUnspecifiedTypeParameter.java -import org.jspecify.nullness.*; - -@NullMarked -public class NullnessUnspecifiedTypeParameter { - public void foo(T t) {} - - public void bar(Test s, T t) {} // t should not become not nullable -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -// jspecify_nullness_mismatch -fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit { - // jspecify_nullness_mismatch - a1.foo(null) - a1.foo(1) - - a2.foo(null) - a2.foo(1) - - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a1.bar(null, null) - // jspecify_nullness_mismatch - a1.bar(x, null) - a1.bar(x, 1) - - // jspecify_nullness_mismatch - a2.bar(null, null) - a2.bar(x, null) - a2.bar(x, 1) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt deleted file mode 100644 index c0abf3b9ff1..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt +++ /dev/null @@ -1,19 +0,0 @@ -package - -public fun main(/*0*/ a1: NullnessUnspecifiedTypeParameter, /*1*/ a2: NullnessUnspecifiedTypeParameter, /*2*/ x: Test): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class NullnessUnspecifiedTypeParameter { - public constructor NullnessUnspecifiedTypeParameter() - public open fun bar(/*0*/ s: Test, /*1*/ t: T): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt deleted file mode 100644 index edb34a9cc8f..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt +++ /dev/null @@ -1,56 +0,0 @@ -// JSPECIFY_STATE: strict - -// FILE: SelfType.java -import org.jspecify.nullness.*; - -@NullMarked -public class SelfType> { - public void foo(T t) {} -} - -// FILE: B.java -public class B extends SelfType {} - -// FILE: C.java -import org.jspecify.nullness.*; - -@NullMarked -public class C> extends SelfType {} - -// FILE: AK.java -public class AK extends SelfType {} - -// FILE: AKN.java -import org.jspecify.nullness.*; - -public class AKN extends SelfType<@Nullable AK> {} - -// FILE: BK.java -public class BK extends B {} - -// FILE: CK.java -public class CK extends C {} - -// FILE: CKN.java -import org.jspecify.nullness.*; - -public class CKN extends C<@Nullable CK> {} - -// FILE: main.kt -fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { - ak.foo(ak) - // jspecify_nullness_mismatch - ak.foo(null) - - akn.foo(null) - - bk.foo(bk) - // jspecify_nullness_mismatch - bk.foo(null) - - ck.foo(ck) - // jspecify_nullness_mismatch - ck.foo(null) - - ckn.foo(null) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt deleted file mode 100644 index b6315df6fac..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt +++ /dev/null @@ -1,68 +0,0 @@ -package - -public fun main(/*0*/ ak: AK, /*1*/ akn: AKN, /*2*/ bk: BK, /*3*/ ck: CK, /*4*/ ckn: CKN): kotlin.Unit - -public open class AK : SelfType { - public constructor AK() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: AK): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class AKN : SelfType<@org.jspecify.nullness.Nullable AK?> { - public constructor AKN() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable AK?): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class B : SelfType { - public constructor B() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class BK : B { - public constructor BK() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class C> : SelfType { - public constructor C>() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: E): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class CK : C { - public constructor CK() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: CK): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class CKN : C<@org.jspecify.nullness.Nullable CK?> { - public constructor CKN() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable CK?): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class SelfType> { - public constructor SelfType>() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt deleted file mode 100644 index 48e6a4562d3..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt +++ /dev/null @@ -1,40 +0,0 @@ -// JSPECIFY_STATE: strict -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode - -// FILE: Simple.java -import org.jspecify.nullness.*; - -@NullMarked -public class Simple { - @Nullable public Derived field = null; - - @Nullable - public Derived foo(Derived x, @NullnessUnspecified Base y) { - return null; - } - - public Derived bar() { - return null; - } -} - -// FILE: Base.java -public class Base {} - -// FILE: Derived.java -public class Derived extends Base { - void foo() {} -} - -// FILE: main.kt -fun main(a: Simple, x: Derived): Unit { - // jspecify_nullness_mismatch - a.foo(x, null).foo() - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a.foo(null, x).foo() - - a.bar().foo() - - // jspecify_nullness_mismatch - a.field.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt deleted file mode 100644 index 6bc0a068e0a..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt +++ /dev/null @@ -1,28 +0,0 @@ -package - -public fun main(/*0*/ a: Simple, /*1*/ x: Derived): kotlin.Unit - -public open class Base { - public constructor Base() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Derived : Base { - public constructor Derived() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open fun foo(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class Simple { - public constructor Simple() - @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived? - public open fun bar(): Derived - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt deleted file mode 100644 index 2d7a26dc912..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt +++ /dev/null @@ -1,49 +0,0 @@ -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode -// JSPECIFY_STATE: strict -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: TypeArgumentsFromParameterBounds.java -import org.jspecify.nullness.*; - -@NullMarked -public class TypeArgumentsFromParameterBounds {} - -// FILE: A.java -import org.jspecify.nullness.*; - -@NullMarked -public class A { - public void bar(TypeArgumentsFromParameterBounds a) {} -} - -// FILE: B.java -import org.jspecify.nullness.*; - -public class B { - public void bar(TypeArgumentsFromParameterBounds a) {} -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNotNullNull: TypeArgumentsFromParameterBounds, - aNotNullNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNullNull: TypeArgumentsFromParameterBounds, - a: A, b: B -): Unit { - a.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNullNotNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNullNull) - - b.bar(aNotNullNotNullNotNull) - b.bar(aNotNullNotNullNull) - b.bar(aNotNullNullNotNull) - b.bar(aNotNullNullNull) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt deleted file mode 100644 index 5c8e882c797..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt +++ /dev/null @@ -1,33 +0,0 @@ -package - -public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class A { - public constructor A() - public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class B { - public constructor B() - public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class TypeArgumentsFromParameterBounds { - public constructor TypeArgumentsFromParameterBounds() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt deleted file mode 100644 index 468edc2c8cc..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt +++ /dev/null @@ -1,46 +0,0 @@ -// JSPECIFY_STATE: strict - -// FILE: A.java -import org.jspecify.nullness.*; - -@NullMarked -public class A { - public void foo(@NullnessUnspecified T t) {} - public void bar(E e) {} -} - -// FILE: B.java -import org.jspecify.nullness.*; -@NullMarked -public class B { - public void foo(T t) {} - public void bar(E e) {} -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -// jspecify_nullness_mismatch, jspecify_nullness_mismatch -fun main(a1: A<Any?>, a2: A, b1: B<Any?>, b2: B, x: T): Unit { - a1.foo(null) - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a1.bar<T?>(null) - a1.bar(x) - - a2.foo(null) - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a2.bar<T?>(null) - a2.bar(x) - - b1.foo(null) - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - b1.bar<T?>(null) - b1.bar(x) - - // jspecify_nullness_mismatch - b2.foo(null) - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - b2.bar<T?>(null) - b2.bar(x) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt deleted file mode 100644 index 67c24662220..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt +++ /dev/null @@ -1,28 +0,0 @@ -package - -public fun main(/*0*/ a1: A, /*1*/ a2: A, /*2*/ b1: B, /*3*/ b2: B, /*4*/ x: T): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class A { - public constructor A() - public open fun bar(/*0*/ e: E): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ @org.jspecify.nullness.NullnessUnspecified t: @org.jspecify.nullness.NullnessUnspecified T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class B { - public constructor B() - public open fun bar(/*0*/ e: E): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt deleted file mode 100644 index 9de21a10463..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// JSPECIFY_STATE: strict -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: WildcardsWithDefault.java -import org.jspecify.nullness.*; - -@NullMarked -public class WildcardsWithDefault { - public void noBoundsNotNull(A a) {} - public void noBoundsNullable(A a) {} -} - -// FILE: A.java -import org.jspecify.nullness.*; - -public class A {} - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: A, - aNotNullNotNullNull: A, - aNotNullNullNotNull: A, - aNotNullNullNull: A, - b: WildcardsWithDefault -): Unit { - b.noBoundsNotNull(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.noBoundsNotNull(aNotNullNotNullNull) - b.noBoundsNotNull(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.noBoundsNotNull(aNotNullNullNull) - - b.noBoundsNullable(aNotNullNotNullNotNull) - b.noBoundsNullable(aNotNullNotNullNull) - b.noBoundsNullable(aNotNullNullNotNull) - b.noBoundsNullable(aNotNullNullNull) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt deleted file mode 100644 index 05e1101e53b..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt +++ /dev/null @@ -1,19 +0,0 @@ -package - -public fun main(/*0*/ aNotNullNotNullNotNull: A, /*1*/ aNotNullNotNullNull: A, /*2*/ aNotNullNullNotNull: A, /*3*/ aNotNullNullNull: A, /*4*/ b: WildcardsWithDefault): kotlin.Unit - -public open class A { - public constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class WildcardsWithDefault { - public constructor WildcardsWithDefault() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun noBoundsNotNull(/*0*/ a: A): kotlin.Unit - public open fun noBoundsNullable(/*0*/ a: A): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt deleted file mode 100644 index 7c214c08363..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt +++ /dev/null @@ -1,89 +0,0 @@ -// JSPECIFY_STATE: warn -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: AnnotatedBoundsOfWildcard.java -import org.jspecify.nullness.*; - -@NullMarked -public class AnnotatedBoundsOfWildcard { - public void superAsIs(Test a) {} - public void superNotNull(Test a) {} - public void superNullable(Test a) {} - - public void extendsAsIs(Test a) {} - public void extendsNotNull(Test a) {} - public void extendsNullable(Test a) {} - - public void noBounds(Test a) {} -} - -// FILE: Base.java -public class Base {} - -// FILE: Derived.java -public class Derived extends Base {} - -// FILE: Test.java -import org.jspecify.nullness.*; - -@NullMarked -public class Test { } - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: Test, - aNotNullNotNullNull: Test, - aNotNullNullNotNull: Test, - aNotNullNullNull: Test, - - aAnyNotNullNotNullNotNull: Test, - aAnyNotNullNotNullNull: Test, - aAnyNotNullNullNotNull: Test, - aAnyNotNullNullNull: Test, - - b: AnnotatedBoundsOfWildcard -): Unit { - // jspecify_nullness_mismatch - b.superAsIs(aAnyNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.superAsIs(aAnyNotNullNotNullNull) - b.superAsIs(aAnyNotNullNullNotNull) - b.superAsIs(aAnyNotNullNullNull) - - b.superNotNull(aAnyNotNullNotNullNotNull) - b.superNotNull(aAnyNotNullNotNullNull) - b.superNotNull(aAnyNotNullNullNotNull) - b.superNotNull(aAnyNotNullNullNull) - - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNotNullNull) - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNullNotNull) - // jspecify_nullness_mismatch - b.superNullable(aAnyNotNullNullNull) - - b.extendsAsIs(aNotNullNotNullNotNull) - b.extendsAsIs(aNotNullNotNullNull) - b.extendsAsIs(aNotNullNullNotNull) - b.extendsAsIs(aNotNullNullNull) - - b.extendsNotNull(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNullNull) - - b.extendsNullable(aNotNullNotNullNotNull) - b.extendsNullable(aNotNullNotNullNull) - b.extendsNullable(aNotNullNullNotNull) - b.extendsNullable(aNotNullNullNull) - - b.noBounds(aNotNullNotNullNotNull) - b.noBounds(aNotNullNotNullNull) - b.noBounds(aNotNullNullNotNull) - b.noBounds(aNotNullNullNull) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt deleted file mode 100644 index 19b0721b871..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt +++ /dev/null @@ -1,38 +0,0 @@ -package - -public fun main(/*0*/ aNotNullNotNullNotNull: Test, /*1*/ aNotNullNotNullNull: Test, /*2*/ aNotNullNullNotNull: Test, /*3*/ aNotNullNullNull: Test, /*4*/ aAnyNotNullNotNullNotNull: Test, /*5*/ aAnyNotNullNotNullNull: Test, /*6*/ aAnyNotNullNullNotNull: Test, /*7*/ aAnyNotNullNullNull: Test, /*8*/ b: AnnotatedBoundsOfWildcard): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class AnnotatedBoundsOfWildcard { - public constructor AnnotatedBoundsOfWildcard() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun extendsAsIs(/*0*/ a: Test!): kotlin.Unit - public open fun extendsNotNull(/*0*/ a: Test!): kotlin.Unit - public open fun extendsNullable(/*0*/ a: Test!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun noBounds(/*0*/ a: Test!): kotlin.Unit - public open fun superAsIs(/*0*/ a: Test!): kotlin.Unit - public open fun superNotNull(/*0*/ a: Test!): kotlin.Unit - public open fun superNullable(/*0*/ a: Test!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Base { - public constructor Base() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Derived : Base { - public constructor Derived() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.kt deleted file mode 100644 index 535765d5a8d..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// JSPECIFY_STATE: warn -// FILE: J1.java -import org.jetbrains.annotations.Nullable; - -public interface J1 { - @Nullable - public static T foo(J1 x) { return null; } -} - -// FILE: J2.java -import org.jspecify.nullness.Nullable; - -public interface J2 extends J1 { } - -// FILE: kotlin.kt -private fun J2<*>.bar() = J1.foo(this) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.txt deleted file mode 100644 index 2b3976fc916..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.txt +++ /dev/null @@ -1,18 +0,0 @@ -package - -private fun J2<*>.bar(): @org.jspecify.nullness.Nullable kotlin.Any? - -public interface J1 { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - @org.jetbrains.annotations.Nullable public open fun foo(/*0*/ x: J1!): @org.jetbrains.annotations.Nullable T? -} - -public interface J2 : J1 { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt deleted file mode 100644 index 38f6c482cc9..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt +++ /dev/null @@ -1,50 +0,0 @@ -// JSPECIFY_STATE: warn - -// FILE: Defaults.java -import org.jspecify.nullness.*; - -@NullMarked -public class Defaults { - public Foo defaultField = null; - @Nullable public Foo field = null; - - public Foo everythingNotNullable(Foo x) { return null; } - - public @Nullable Foo everythingNullable(@Nullable Foo x) { return null; } - - public @NullnessUnspecified Foo everythingUnknown(@NullnessUnspecified Foo x) { return null; } - - public @Nullable Foo mixed(Foo x) { return null; } - - public Foo explicitlyNullnessUnspecified(@NullnessUnspecified Foo x) { return null; } -} - -// FILE: Foo.java -public class Foo { - public Object foo() { return null; } -} - -// FILE: main.kt -fun main(a: Defaults, x: Foo): Unit { - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo() - a.everythingNotNullable(x).foo() - - // jspecify_nullness_mismatch - a.everythingNullable(null).foo() - - a.everythingUnknown(null).foo() - - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a.mixed(null).foo() - // jspecify_nullness_mismatch - a.mixed(x).foo() - - a.explicitlyNullnessUnspecified(x).foo() - a.explicitlyNullnessUnspecified(null).foo() - - a.defaultField.foo() - - // jspecify_nullness_mismatch - a.field.foo() -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt deleted file mode 100644 index 39b1a4af2a1..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt +++ /dev/null @@ -1,25 +0,0 @@ -package - -public fun main(/*0*/ a: Defaults, /*1*/ x: Foo): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class Defaults { - public constructor Defaults() - public final var defaultField: Foo! - @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Foo! - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun everythingNotNullable(/*0*/ x: Foo!): Foo! - @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Foo!): @org.jspecify.nullness.Nullable Foo! - @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): @org.jspecify.nullness.NullnessUnspecified Foo! - public open fun explicitlyNullnessUnspecified(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): Foo! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - @org.jspecify.nullness.Nullable public open fun mixed(/*0*/ x: Foo!): @org.jspecify.nullness.Nullable Foo! - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Foo { - public constructor Foo() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(): kotlin.Any! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt deleted file mode 100644 index 1b4442ffe0b..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt +++ /dev/null @@ -1,48 +0,0 @@ -// JSPECIFY_STATE: warn - -// FILE: IgnoreAnnotations.java -import org.jspecify.nullness.*; - -@NullMarked -public class IgnoreAnnotations { - @Nullable public Derived field = null; - - @Nullable - public Derived foo(Derived x, @NullnessUnspecified Base y) { - return null; - } - - public Derived everythingNotNullable(Derived x) { return null; } - - public @Nullable Derived everythingNullable(@Nullable Derived x) { return null; } - - public @NullnessUnspecified Derived everythingUnknown(@NullnessUnspecified Derived x) { return null; } -} - -// FILE: Base.java -public class Base { - void foo() {} -} - -// FILE: Derived.java -public class Derived extends Base { } - -// FILE: main.kt -fun main(a: IgnoreAnnotations, x: Derived): Unit { - // jspecify_nullness_mismatch - a.foo(x, null).foo() - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a.foo(null, x).foo() - - // jspecify_nullness_mismatch - a.field.foo() - - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo() - a.everythingNotNullable(x).foo() - - // jspecify_nullness_mismatch - a.everythingNullable(null).foo() - - a.everythingUnknown(null).foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt deleted file mode 100644 index 48975fb4dcf..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt +++ /dev/null @@ -1,31 +0,0 @@ -package - -public fun main(/*0*/ a: IgnoreAnnotations, /*1*/ x: Derived): kotlin.Unit - -public open class Base { - public constructor Base() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open fun foo(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Derived : Base { - public constructor Derived() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class IgnoreAnnotations { - public constructor IgnoreAnnotations() - @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived! - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun everythingNotNullable(/*0*/ x: Derived!): Derived! - @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Derived!): @org.jspecify.nullness.Nullable Derived! - @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Derived!): @org.jspecify.nullness.NullnessUnspecified Derived! - @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived!, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt deleted file mode 100644 index ebb2ef5ec16..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// JSPECIFY_STATE: warn -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: NonPlatformTypeParameter.java -import org.jspecify.nullness.*; - -public class NonPlatformTypeParameter { - public void foo(T t) {} - public void bar(E e) {} -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { - a1.foo(null) - a1.bar(null) - // jspecify_nullness_mismatch - a1.bar(null) - a1.bar(x) - - // jspecify_nullness_mismatch - a2.foo(null) - a2.bar(null) - // jspecify_nullness_mismatch - a2.bar(null) - a2.bar(x) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt deleted file mode 100644 index 3e3674f724a..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt +++ /dev/null @@ -1,19 +0,0 @@ -package - -public fun main(/*0*/ a1: NonPlatformTypeParameter, /*1*/ a2: NonPlatformTypeParameter, /*2*/ x: T): kotlin.Unit - -public open class NonPlatformTypeParameter { - public constructor NonPlatformTypeParameter() - public open fun bar(/*0*/ e: E!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt deleted file mode 100644 index aab0423ec00..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// JSPECIFY_STATE: warn -// FILE: NullnessUnspecifiedTypeParameter.java -import org.jspecify.nullness.*; - -@NullMarked -public class NullnessUnspecifiedTypeParameter { - public void foo(T t) {} - - public void bar(Test s, T t) {} // t should not become not nullable -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter, x: Test): Unit { - // jspecify_nullness_mismatch - a1.foo(null) - a1.foo(1) - - // jspecify_nullness_mismatch - a2.foo(null) - a2.foo(1) - - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a1.bar(null, null) - // jspecify_nullness_mismatch - a1.bar(x, null) - a1.bar(x, 1) - - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a2.bar(null, null) - // jspecify_nullness_mismatch - a2.bar(x, null) - a2.bar(x, 1) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt deleted file mode 100644 index 163bebaf51d..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt +++ /dev/null @@ -1,19 +0,0 @@ -package - -public fun main(/*0*/ a1: NullnessUnspecifiedTypeParameter, /*1*/ a2: NullnessUnspecifiedTypeParameter, /*2*/ x: Test): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class NullnessUnspecifiedTypeParameter { - public constructor NullnessUnspecifiedTypeParameter() - public open fun bar(/*0*/ s: Test!, /*1*/ t: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt deleted file mode 100644 index a979e29ec58..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt +++ /dev/null @@ -1,59 +0,0 @@ -// JSPECIFY_STATE: warn -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: SelfType.java -import org.jspecify.nullness.*; - -@NullMarked -public class SelfType> { - public void foo(T t) {} -} - -// FILE: B.java -public class B extends SelfType {} - -// FILE: C.java -import org.jspecify.nullness.*; - -@NullMarked -public class C> extends SelfType {} - -// FILE: AK.java -public class AK extends SelfType {} - -// FILE: AKN.java -import org.jspecify.nullness.*; - -public class AKN extends SelfType<@Nullable AK> {} - -// FILE: BK.java -public class BK extends B {} - -// FILE: CK.java -public class CK extends C {} - -// FILE: CKN.java -import org.jspecify.nullness.*; - -public class CKN extends C<@Nullable CK> {} - -// FILE: main.kt -fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { - ak.foo(ak) - // jspecify_nullness_mismatch - ak.foo(null) - - // jspecify_nullness_mismatch - akn.foo(null) - - bk.foo(bk) - // jspecify_nullness_mismatch - bk.foo(null) - - ck.foo(ck) - // jspecify_nullness_mismatch - ck.foo(null) - - // jspecify_nullness_mismatch - ckn.foo(null) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt deleted file mode 100644 index 13dcbe9573f..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt +++ /dev/null @@ -1,67 +0,0 @@ -package - -public fun main(/*0*/ ak: AK, /*1*/ akn: AKN, /*2*/ bk: BK, /*3*/ ck: CK, /*4*/ ckn: CKN): kotlin.Unit - -public open class AK : SelfType { - public constructor AK() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: AK!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class AKN : SelfType<@org.jspecify.nullness.Nullable AK!> { - public constructor AKN() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable AK!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class B : SelfType { - public constructor B() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class BK : B { - public constructor BK() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class C!> : SelfType { - public constructor C!>() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: E!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class CK : C { - public constructor CK() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: CK!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class CKN : C<@org.jspecify.nullness.Nullable CK!> { - public constructor CKN() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable CK!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class SelfType!> { - public constructor SelfType!>() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt deleted file mode 100644 index 9263196c9d5..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt +++ /dev/null @@ -1,39 +0,0 @@ -// JSPECIFY_STATE: warn - -// FILE: Simple.java -import org.jspecify.nullness.*; - -@NullMarked -public class Simple { - @Nullable public Derived field = null; - - @Nullable - public Derived foo(Derived x, @NullnessUnspecified Base y) { - return null; - } - - public Derived bar() { - return null; - } -} - -// FILE: Base.java -public class Base {} - -// FILE: Derived.java -public class Derived extends Base { - void foo() {} -} - -// FILE: main.kt -fun main(a: Simple, x: Derived): Unit { - // jspecify_nullness_mismatch - a.foo(x, null).foo() - // jspecify_nullness_mismatch, jspecify_nullness_mismatch - a.foo(null, x).foo() - - a.bar().foo() - - // jspecify_nullness_mismatch - a.field.foo() -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt deleted file mode 100644 index 2c5e02f7f60..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt +++ /dev/null @@ -1,28 +0,0 @@ -package - -public fun main(/*0*/ a: Simple, /*1*/ x: Derived): kotlin.Unit - -public open class Base { - public constructor Base() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Derived : Base { - public constructor Derived() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open fun foo(): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class Simple { - public constructor Simple() - @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived! - public open fun bar(): Derived! - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived!, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt deleted file mode 100644 index 662f411c049..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt +++ /dev/null @@ -1,48 +0,0 @@ -// JSPECIFY_STATE: warn -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: TypeArgumentsFromParameterBounds.java -import org.jspecify.nullness.*; - -@NullMarked -public class TypeArgumentsFromParameterBounds {} - -// FILE: A.java -import org.jspecify.nullness.*; - -@NullMarked -public class A { - public void bar(TypeArgumentsFromParameterBounds a) {} -} - -// FILE: B.java -import org.jspecify.nullness.*; - -public class B { - public void bar(TypeArgumentsFromParameterBounds a) {} -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNotNullNull: TypeArgumentsFromParameterBounds, - aNotNullNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNullNull: TypeArgumentsFromParameterBounds, - a: A, b: B -): Unit { - a.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNullNotNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNullNull) - - b.bar(aNotNullNotNullNotNull) - b.bar(aNotNullNotNullNull) - b.bar(aNotNullNullNotNull) - b.bar(aNotNullNullNull) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt deleted file mode 100644 index 3b976ffbc39..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt +++ /dev/null @@ -1,33 +0,0 @@ -package - -public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class A { - public constructor A() - public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class B { - public constructor B() - public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class TypeArgumentsFromParameterBounds { - public constructor TypeArgumentsFromParameterBounds() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt deleted file mode 100644 index c2e78d2288d..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt +++ /dev/null @@ -1,45 +0,0 @@ -// JSPECIFY_STATE: warn -// FILE: A.java -import org.jspecify.nullness.*; - -@NullMarked -public class A { - public void foo(@NullnessUnspecified T t) {} - public void bar(E e) {} -} - -// FILE: B.java -import org.jspecify.nullness.*; -@NullMarked -public class B { - public void foo(T t) {} - public void bar(E e) {} -} - -// FILE: Test.java -public class Test {} - -// FILE: main.kt -fun main(a1: A, a2: A, b1: B, b2: B, x: T): Unit { - a1.foo(null) - // jspecify_nullness_mismatch - a1.bar(null) - a1.bar(x) - - a2.foo(null) - // jspecify_nullness_mismatch - a2.bar(null) - a2.bar(x) - - // jspecify_nullness_mismatch - b1.foo(null) - // jspecify_nullness_mismatch - b1.bar(null) - b1.bar(x) - - // jspecify_nullness_mismatch - b2.foo(null) - // jspecify_nullness_mismatch - b2.bar(null) - b2.bar(x) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt deleted file mode 100644 index 68809cb4e1f..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt +++ /dev/null @@ -1,28 +0,0 @@ -package - -public fun main(/*0*/ a1: A, /*1*/ a2: A, /*2*/ b1: B, /*3*/ b2: B, /*4*/ x: T): kotlin.Unit - -@org.jspecify.nullness.NullMarked public open class A { - public constructor A() - public open fun bar(/*0*/ e: E!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ @org.jspecify.nullness.NullnessUnspecified t: @org.jspecify.nullness.NullnessUnspecified T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class B { - public constructor B() - public open fun bar(/*0*/ e: E!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun foo(/*0*/ t: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class Test { - public constructor Test() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt deleted file mode 100644 index ab04f5996ba..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// JSPECIFY_STATE: warn -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: WildcardsWithDefault.java -import org.jspecify.nullness.*; - -@NullMarked -public class WildcardsWithDefault { - public void noBoundsNotNull(A a) {} - public void noBoundsNullable(A a) {} -} - -// FILE: A.java -import org.jspecify.nullness.*; - -public class A {} - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: A, - aNotNullNotNullNull: A, - aNotNullNullNotNull: A, - aNotNullNullNull: A, - b: WildcardsWithDefault -): Unit { - b.noBoundsNotNull(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.noBoundsNotNull(aNotNullNotNullNull) - b.noBoundsNotNull(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.noBoundsNotNull(aNotNullNullNull) - - b.noBoundsNullable(aNotNullNotNullNotNull) - b.noBoundsNullable(aNotNullNotNullNull) - b.noBoundsNullable(aNotNullNullNotNull) - b.noBoundsNullable(aNotNullNullNull) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt deleted file mode 100644 index 132ecb62505..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt +++ /dev/null @@ -1,19 +0,0 @@ -package - -public fun main(/*0*/ aNotNullNotNullNotNull: A, /*1*/ aNotNullNotNullNull: A, /*2*/ aNotNullNullNotNull: A, /*3*/ aNotNullNullNull: A, /*4*/ b: WildcardsWithDefault): kotlin.Unit - -public open class A { - public constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@org.jspecify.nullness.NullMarked public open class WildcardsWithDefault { - public constructor WildcardsWithDefault() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun noBoundsNotNull(/*0*/ a: A<*, *, *>!): kotlin.Unit - public open fun noBoundsNullable(/*0*/ a: A!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.kt deleted file mode 100644 index 25d923df9ca..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.kt +++ /dev/null @@ -1,38 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: AnnotatedTypeArguments.java -import org.checkerframework.checker.nullness.qual.*; - -interface P {} -interface L {} -interface S {} - -class AnnotatedTypeArguments { - - class A { - L, S>> foo(L, S>> x) {return null;} - } - - class B extends A { - // some complicated type tree - // return type and argument's type differ only by nullability of outermost type - @Nullable - L, @NonNull S>> foo(@NonNull L, @NonNull S>> x) {return null;} - } - - class C extends B { - // signature should be the same as in A - L, S>> foo(L, S>> x) {return null;} - } - - class D1 extends C { - // signature should be the same as in A, but annotated String-type should be platform - L, S>> foo(L, S>> x) {return null;} - } - - class D2 extends C { - // return type refined to not-nullable - // argument type here same as in A except outermost type (it becomes flexible because of conflict) - @NonNull - L, S>> foo(@Nullable L, S>> x) {return null;} - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.txt deleted file mode 100644 index 9cee33afe67..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.txt +++ /dev/null @@ -1,48 +0,0 @@ -package - -public/*package*/ open class AnnotatedTypeArguments { - public/*package*/ constructor AnnotatedTypeArguments() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public/*package*/ open inner class A { - public/*package*/ constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open fun foo(/*0*/ x: L!, S<*>!>!>!): L!, S<*>!>!>! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class B : AnnotatedTypeArguments.A { - public/*package*/ constructor B() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull x: @org.checkerframework.checker.nullness.qual.NonNull L, @org.checkerframework.checker.nullness.qual.NonNull S<*>>!>): @org.checkerframework.checker.nullness.qual.Nullable L, @org.checkerframework.checker.nullness.qual.NonNull S<*>>!>? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class C : AnnotatedTypeArguments.B { - public/*package*/ constructor C() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open override /*1*/ fun foo(/*0*/ x: L, S<*>>!>): L, S<*>>!>? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class D1 : AnnotatedTypeArguments.C { - public/*package*/ constructor D1() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open override /*1*/ fun foo(/*0*/ x: L, S<*>>!>): L, S<*>>!>? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class D2 : AnnotatedTypeArguments.C { - public/*package*/ constructor D2() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable L, S<*>>!>!): @org.checkerframework.checker.nullness.qual.NonNull L, S<*>>!> - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt deleted file mode 100644 index 05862c5d66e..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// SKIP_TXT -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: ClassTypeParameterBound.java - -import org.jetbrains.annotations.NotNull; - -public class ClassTypeParameterBound { - ClassTypeParameterBound(T x) { } - ClassTypeParameterBound() { } -} - -// FILE: main.kt -fun main(x: ClassTypeParameterBound<String?>, y: ClassTypeParameterBound, a: String?, b: String) { - val x2 = ClassTypeParameterBound<String?>() - val y2 = ClassTypeParameterBound() - - val x3 = ClassTypeParameterBound(a) - val y3 = ClassTypeParameterBound(b) - - val x4: ClassTypeParameterBound<String?> = ClassTypeParameterBound() - val y4: ClassTypeParameterBound = ClassTypeParameterBound() -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt deleted file mode 100644 index 7ec7f0044d9..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// SKIP_TXT -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: ClassTypeParameterBoundWithWarnings.java - -import org.jetbrains.annotations.NotNull; - -public class ClassTypeParameterBoundWithWarnings { - ClassTypeParameterBoundWithWarnings() { } - ClassTypeParameterBoundWithWarnings(T x) { } -} - -// FILE: main.kt -fun main(x: ClassTypeParameterBoundWithWarnings<String?>, y: ClassTypeParameterBoundWithWarnings, a: String?, b: String) { - val x2 = ClassTypeParameterBoundWithWarnings<String?>() - val y2 = ClassTypeParameterBoundWithWarnings() - - val x3 = ClassTypeParameterBoundWithWarnings(a) - val y3 = ClassTypeParameterBoundWithWarnings(b) - - val x4: ClassTypeParameterBoundWithWarnings<String?> = ClassTypeParameterBoundWithWarnings() - val y4: ClassTypeParameterBoundWithWarnings = ClassTypeParameterBoundWithWarnings() -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.fir.kt deleted file mode 100644 index ebf931dbd5d..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// SKIP_TXT -// FILE: I1.java -import org.checkerframework.checker.nullness.qual.NonNull; - -public interface I1<@NonNull T> { } - -// FILE: I2.java -public interface I2> { } - -// FILE: main.kt -fun foo(): I2<*> = TODO() diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.kt deleted file mode 100644 index 612eae0693d..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.kt +++ /dev/null @@ -1,54 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: Outer.java -import org.checkerframework.checker.nullness.qual.*; - -interface X {} -interface Y {} - -class Outer { - class A { - V foo(K x) { return null; } - - X bar(Y x) { return null; } - } - - class B extends A { - // OK, non-platform types - @Override - @NonNull - T2 foo(@Nullable T1 x) { return null; } - - // Parameter type is fully non-flexible (OK) - // Return type is `X?`. - // The reason is that we do not treat it as equal to return type of A.bar because they are base on different type parameters, - // so type enhancing happens only for outermost type. - // TODO: We should properly compare equality with specific local equality axioms (as when calculating overriden descriptors) - @Override - @Nullable - X<@Nullable R> bar(@NonNull Y<@NonNull R> x) { return null; } - } - - class C extends B { - // OK, non-platform types - @Override - J foo(I x) { return null; } - - // Parameter type is fully non-flexible (OK) - // Return type is `X?`, same is in B - @Override - X bar(Y x) { return null; } - } - - class D extends C { - // Return type is not-nullable, covariantly overridden, OK - // Parameter type is flexible, because of conflict with supertype, OK - @Override - @NonNull - W foo(@Nullable U x) { return null; } - - - @Override - @NonNull - X<@NonNull F> bar(@Nullable Y<@Nullable F> x) { return null; } - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.txt deleted file mode 100644 index 04a50e87fa7..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.txt +++ /dev/null @@ -1,44 +0,0 @@ -package - -public/*package*/ open class Outer { - public/*package*/ constructor Outer() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public/*package*/ open inner class A { - public/*package*/ constructor A() - public/*package*/ open fun bar(/*0*/ x: Y!): X! - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open fun foo(/*0*/ x: K!): V! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class B : Outer.A { - public/*package*/ constructor B() - @java.lang.Override @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open override /*1*/ fun bar(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull x: @org.checkerframework.checker.nullness.qual.NonNull Y<@org.checkerframework.checker.nullness.qual.NonNull R!!>): @org.checkerframework.checker.nullness.qual.Nullable X<@org.checkerframework.checker.nullness.qual.Nullable R!>? - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable T1?): @org.checkerframework.checker.nullness.qual.NonNull T2!! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class C : Outer.B { - public/*package*/ constructor C() - @java.lang.Override public/*package*/ open override /*1*/ fun bar(/*0*/ x: Y): X? - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override public/*package*/ open override /*1*/ fun foo(/*0*/ x: I?): J!! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class D : Outer.C { - public/*package*/ constructor D() - @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun bar(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable Y<@org.checkerframework.checker.nullness.qual.Nullable F!>!): @org.checkerframework.checker.nullness.qual.NonNull X<@org.checkerframework.checker.nullness.qual.NonNull F!> - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable U?): @org.checkerframework.checker.nullness.qual.NonNull W!! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt deleted file mode 100644 index 7ae642b8032..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// SOURCE_RETENTION_ANNOTATIONS -// FILE: BaseClass.java -import org.checkerframework.checker.nullness.qual.*; - -public class BaseClass { - public void loadCache(@NonNull Object... args) {} -} - -// FILE: main.kt -class A : BaseClass() { - // org.checkerframework.checker.nullness.qual.NonNull has @Target TYPE_USE, so it affects only elements type - override fun loadCache(vararg args: Any?) { - super.loadCache(*args) - } -} - -class B : BaseClass() { - override fun loadCache(vararg args: Any) { - super.loadCache(*args) - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt deleted file mode 100644 index c0cc78617dd..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt +++ /dev/null @@ -1,26 +0,0 @@ -package - -public final class A : BaseClass { - public constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull vararg args: @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any>!*/): kotlin.Unit - public open fun loadCache(/*0*/ vararg args: kotlin.Any? /*kotlin.Array*/): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final class B : BaseClass { - public constructor B() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ fun loadCache(/*0*/ vararg args: kotlin.Any /*kotlin.Array*/): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class BaseClass { - public constructor BaseClass() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull vararg args: @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any>!*/): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt deleted file mode 100644 index 1edf4df72cd..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// SOURCE_RETENTION_ANNOTATIONS -// FILE: BaseClass.java -import org.checkerframework.checker.nullness.qual.*; - -public class BaseClass { - public void loadCache(@Nullable Object... args) {} -} - -// FILE: main.kt -class A : BaseClass() { - override fun loadCache(vararg args: Any?) { - super.loadCache(*args) - } -} - -class B : BaseClass() { - // org.checkerframework.checker.nullness.qual.Nullable has @Target TYPE_USE, so it affects only elements type - override fun loadCache(vararg args: Any) { - super.loadCache(*args) - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.txt deleted file mode 100644 index 9b20edfe5cd..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.txt +++ /dev/null @@ -1,26 +0,0 @@ -package - -public final class A : BaseClass { - public constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ fun loadCache(/*0*/ vararg args: kotlin.Any? /*kotlin.Array*/): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final class B : BaseClass { - public constructor B() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable vararg args: @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any? /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any?>!*/): kotlin.Unit - public open fun loadCache(/*0*/ vararg args: kotlin.Any /*kotlin.Array*/): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public open class BaseClass { - public constructor BaseClass() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable vararg args: @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any? /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any?>!*/): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt deleted file mode 100644 index 23cda598c7d..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt +++ /dev/null @@ -1,65 +0,0 @@ -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated -// !DIAGNOSTICS: -UNUSED_PARAMETER -// SKIP_TXT -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: ReturnType.java - -import org.jetbrains.annotations.*; - -public class ReturnType { - public interface A {} - - public A<@Nullable String, @Nullable T> foo1() { return null; } - public A<@Nullable String, @NotNull T> foo2() { return null; } - public A<@NotNull String, @NotNull T> foo3 = null; - public @NotNull T [] foo4 = null; - public ReturnType<@Nullable String> foo41 = null; - public T foo411 = null; - public @Nullable String [] foo5() { return null; } -} - -// FILE: main.kt -fun takeNotNullStringAndKNullable(x: ReturnType.A) {} -fun takeNullableStringAndKNullable(x: ReturnType.A) {} -fun takeNotNullStringAndNotNullK(x: ReturnType.A) {} -fun takeNullableStringAndNotNullK(x: ReturnType.A) {} -fun takeNotNullString(x: String) {} - -fun takeArrayOfNotNullString(x: Array) {} -fun takeArrayOfNullableString(x: Array) {} -fun takeArrayOfNotNullK(x: Array) {} -fun takeArrayOfNullableK(x: Array) {} - -fun main(a: ReturnType) { - val x1 = a.foo1() - takeNotNullStringAndKNullable(x1) - takeNullableStringAndKNullable(x1) - takeNotNullStringAndNotNullK(x1) - takeNullableStringAndNotNullK(x1) - takeNotNullString(a.foo41.foo411) - - val x2 = a.foo2() - takeNotNullStringAndKNullable(x2) - takeNullableStringAndKNullable(x2) - takeNotNullStringAndNotNullK(x2) - takeNullableStringAndNotNullK(x2) - - val x3 = a.foo3 - takeNotNullStringAndKNullable(x3) - takeNullableStringAndKNullable(x3) - takeNotNullStringAndNotNullK(x3) - takeNullableStringAndNotNullK(x3) - - val x4 = a.foo4 - takeArrayOfNotNullString(x4) - takeArrayOfNullableString(x4) - takeArrayOfNotNullK(x4) - takeArrayOfNullableK(x4) - - val x5 = a.foo5() - takeArrayOfNotNullString(x5) - takeArrayOfNullableString(x5) - takeArrayOfNotNullK(x5) - takeArrayOfNullableK(x5) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.kt deleted file mode 100644 index cba2ba66427..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: Outer.java -import org.checkerframework.checker.nullness.qual.*; - -interface Base {} -interface Derived extends Base {} - -class Outer { - class A { - @Nullable Base<@NonNull String> foo() { return null; } - } - - class B extends A { - @Override - Base foo() { return null; } - } - - class C extends A { - @Override - @NonNull Base foo() { return null; } - } - - class D extends A { - @Override - Derived foo() { return null; } - } - - class E extends A { - @Override - @NonNull Derived foo() { return null; } - } - - class F extends A { - @Override - @NonNull Derived<@NonNull String> foo() { return null; } - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.txt deleted file mode 100644 index fcd3a73fa92..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.txt +++ /dev/null @@ -1,56 +0,0 @@ -package - -public/*package*/ open class Outer { - public/*package*/ constructor Outer() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public/*package*/ open inner class A { - public/*package*/ constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open fun foo(): @org.checkerframework.checker.nullness.qual.Nullable Base<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String>? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class B : Outer.A { - public/*package*/ constructor B() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override public/*package*/ open override /*1*/ fun foo(): Base? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class C : Outer.A { - public/*package*/ constructor C() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(): @org.checkerframework.checker.nullness.qual.NonNull Base - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class D : Outer.A { - public/*package*/ constructor D() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override public/*package*/ open override /*1*/ fun foo(): Derived? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class E : Outer.A { - public/*package*/ constructor E() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(): @org.checkerframework.checker.nullness.qual.NonNull Derived - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public/*package*/ open inner class F : Outer.A { - public/*package*/ constructor F() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(): @org.checkerframework.checker.nullness.qual.NonNull Derived<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String!> - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.kt deleted file mode 100644 index 7c0c378dcc3..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// SOURCE_RETENTION_ANNOTATIONS -// FILE: Base.java -public interface Base {} -// FILE: A.java -import org.checkerframework.checker.nullness.qual.*; - -public class A { - @Nullable Base<@NonNull String> foo() { return null; } -} - -// FILE: a.kt -interface Derived : Base {} - -fun bar1(): Derived = null!! -fun bar2(): Derived = null!! - -class B : A() { - override fun foo(): Base { return bar1(); } -} - -class C1 : A() { - override fun foo(): Derived { return bar1(); } -} - -class C2 : A() { - override fun foo(): Derived? { return bar1(); } -} - -class C3 : A() { - override fun foo(): Derived { return bar2(); } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.txt deleted file mode 100644 index bedd264fb31..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.txt +++ /dev/null @@ -1,56 +0,0 @@ -package - -public fun bar1(): Derived -public fun bar2(): Derived - -public open class A { - public constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open fun foo(): @org.checkerframework.checker.nullness.qual.Nullable Base<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String>? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final class B : A { - public constructor B() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - protected open override /*1*/ fun foo(): Base - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public interface Base { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final class C1 : A { - public constructor C1() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - protected open override /*1*/ fun foo(): Derived - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final class C2 : A { - public constructor C2() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - protected open override /*1*/ fun foo(): Derived? - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final class C3 : A { - public constructor C3() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - protected open override /*1*/ fun foo(): Derived - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public interface Derived : Base { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt deleted file mode 100644 index d85017dfa9c..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt +++ /dev/null @@ -1,67 +0,0 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode -// !DIAGNOSTICS: -UNUSED_PARAMETER -// SKIP_TXT -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: ReturnTypeWithWarnings.java -// We've already had errors in source mode, so it's relevant only for binaries for now -// INCLUDE_JAVA_AS_BINARY - -import org.jetbrains.annotations.*; - -public class ReturnTypeWithWarnings { - public interface A {} - - public A<@Nullable String, @Nullable T> foo1() { return null; } - public A<@Nullable String, @NotNull T> foo2() { return null; } - public A<@NotNull String, @NotNull T> foo3 = null; - public @NotNull T [] foo4 = null; - public ReturnTypeWithWarnings<@Nullable String> foo41 = null; - public T foo411 = null; - public @Nullable String [] foo5() { return null; } -} - -// FILE: main.kt -fun takeNotNullStringAndKNullable(x: ReturnTypeWithWarnings.A) {} -fun takeNullableStringAndKNullable(x: ReturnTypeWithWarnings.A) {} -fun takeNotNullStringAndNotNullK(x: ReturnTypeWithWarnings.A) {} -fun takeNullableStringAndNotNullK(x: ReturnTypeWithWarnings.A) {} -fun takeNotNullString(x: String) {} - -fun takeArrayOfNotNullString(x: Array) {} -fun takeArrayOfNullableString(x: Array) {} -fun takeArrayOfNotNullK(x: Array) {} -fun takeArrayOfNullableK(x: Array) {} - -fun main(a: ReturnTypeWithWarnings) { - val x1 = a.foo1() - takeNotNullStringAndKNullable(x1) - takeNullableStringAndKNullable(x1) - takeNotNullStringAndNotNullK(x1) - takeNullableStringAndNotNullK(x1) - takeNotNullString(a.foo41.foo411) - - val x2 = a.foo2() - takeNotNullStringAndKNullable(x2) - takeNullableStringAndKNullable(x2) - takeNotNullStringAndNotNullK(x2) - takeNullableStringAndNotNullK(x2) - - val x3 = a.foo3 - takeNotNullStringAndKNullable(x3) - takeNullableStringAndKNullable(x3) - takeNotNullStringAndNotNullK(x3) - takeNullableStringAndNotNullK(x3) - - val x4 = a.foo4 - takeArrayOfNotNullString(x4) - takeArrayOfNullableString(x4) - takeArrayOfNotNullK(x4) - takeArrayOfNullableK(x4) - - val x5 = a.foo5() - takeArrayOfNotNullString(x5) - takeArrayOfNullableString(x5) - takeArrayOfNotNullK(x5) - takeArrayOfNullableK(x5) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.kt deleted file mode 100644 index 31002a7bded..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// FILE: A.java -import org.checkerframework.checker.nullness.qual.*; -import java.util.*; - -class A { - List<@NonNull String> foo() { return null; } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.txt deleted file mode 100644 index f9e9dcf1c1b..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.txt +++ /dev/null @@ -1,9 +0,0 @@ -package - -public/*package*/ open class A { - public/*package*/ constructor A() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public/*package*/ open fun foo(): kotlin.collections.(Mutable)List<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String>! - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt deleted file mode 100644 index 8b91487d8c7..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt +++ /dev/null @@ -1,62 +0,0 @@ -// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated -// !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS -// SKIP_TXT -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: ValueParameter.java - -import org.jetbrains.annotations.*; - -public class ValueParameter { - public interface A {} - - public void foo1(A<@Nullable String, @Nullable T> x) { } - public void foo2(A<@Nullable String, @NotNull T> x) { } - public void foo3(A<@NotNull String, @NotNull T> x) { } - public void foo4(@NotNull T [] x) { } - public void foo41(@Nullable String x) { } - public void foo411(T x) { } - public void foo5(@Nullable String [] x) { } -} - -// FILE: main.kt -fun getNotNullStringAndKNullable() = null as ValueParameter.A -fun getNullableStringAndKNullable() = null as ValueParameter.A -fun getNotNullStringAndNotNullK() = null as ValueParameter.A -fun getNullableStringAndNotNullK() = null as ValueParameter.A -fun getNotNullString() = null as String - -fun getArrayOfNotNullString() = null as Array -fun getArrayOfNullableString() = null as Array -fun getArrayOfNotNullK() = null as Array -fun getArrayOfNullableK() = null as Array - -fun main(a: ValueParameter) { - a.foo1(getNotNullStringAndKNullable()) - a.foo1(getNullableStringAndKNullable()) - a.foo1(getNotNullStringAndNotNullK()) - a.foo1(getNullableStringAndNotNullK()) - - a.foo2(getNotNullStringAndKNullable()) - a.foo2(getNullableStringAndKNullable()) - a.foo2(getNotNullStringAndNotNullK()) - a.foo2(getNullableStringAndNotNullK()) - - a.foo3(getNotNullStringAndKNullable()) - a.foo3(getNullableStringAndKNullable()) - a.foo3(getNotNullStringAndNotNullK()) - a.foo3(getNullableStringAndNotNullK()) - - a.foo4(getArrayOfNotNullString()) - a.foo4(getArrayOfNullableString()) - a.foo4(getArrayOfNotNullK()) - a.foo4(getArrayOfNullableK()) - - a.foo5(getArrayOfNotNullString()) - a.foo5(getArrayOfNullableString()) - a.foo5(getArrayOfNotNullK()) - a.foo5(getArrayOfNullableK()) - - a.foo41(getNotNullString()) - a.foo411(getNotNullString()) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt deleted file mode 100644 index c55a0e3cdfb..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt +++ /dev/null @@ -1,64 +0,0 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode -// !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS -// SKIP_TXT -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: ValueParameterWithWarnings.java -// We've already had errors in source mode, so it's relevant only for binaries for now -// INCLUDE_JAVA_AS_BINARY - -import org.jetbrains.annotations.*; - -public class ValueParameterWithWarnings { - public interface A {} - - public void foo1(A<@Nullable String, @Nullable T> x) { } - public void foo2(A<@Nullable String, @NotNull T> x) { } - public void foo3(A<@NotNull String, @NotNull T> x) { } - public void foo4(@NotNull T [] x) { } - public void foo41(@Nullable String x) { } - public void foo411(T x) { } - public void foo5(@Nullable String [] x) { } -} - -// FILE: main.kt -fun getNotNullStringAndKNullable() = null as ValueParameterWithWarnings.A -fun getNullableStringAndKNullable() = null as ValueParameterWithWarnings.A -fun getNotNullStringAndNotNullK() = null as ValueParameterWithWarnings.A -fun getNullableStringAndNotNullK() = null as ValueParameterWithWarnings.A -fun getNotNullString() = null as String - -fun getArrayOfNotNullString() = null as Array -fun getArrayOfNullableString() = null as Array -fun getArrayOfNotNullK() = null as Array -fun getArrayOfNullableK() = null as Array - -fun main(a: ValueParameterWithWarnings) { - a.foo1(getNotNullStringAndKNullable()) - a.foo1(getNullableStringAndKNullable()) - a.foo1(getNotNullStringAndNotNullK()) - a.foo1(getNullableStringAndNotNullK()) - - a.foo2(getNotNullStringAndKNullable()) - a.foo2(getNullableStringAndKNullable()) - a.foo2(getNotNullStringAndNotNullK()) - a.foo2(getNullableStringAndNotNullK()) - - a.foo3(getNotNullStringAndKNullable()) - a.foo3(getNullableStringAndKNullable()) - a.foo3(getNotNullStringAndNotNullK()) - a.foo3(getNullableStringAndNotNullK()) - - a.foo4(getArrayOfNotNullString()) - a.foo4(getArrayOfNullableString()) - a.foo4(getArrayOfNotNullK()) - a.foo4(getArrayOfNullableK()) - - a.foo5(getArrayOfNotNullString()) - a.foo5(getArrayOfNullableString()) - a.foo5(getArrayOfNotNullK()) - a.foo5(getArrayOfNullableK()) - - a.foo41(getNotNullString()) - a.foo411(getNotNullString()) -} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaTestGenerated.java index 96c5983b144..22ac5e8d5ab 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaTestGenerated.java @@ -23,7 +23,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Tests { @Test public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -140,7 +140,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -179,7 +179,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Ignore { @Test public void testAllFilesPresentInIgnore() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -195,7 +195,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class NullabilityWarnings { @Test public void testAllFilesPresentInNullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -246,7 +246,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class FromPlatformTypes { @Test public void testAllFilesPresentInFromPlatformTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -376,7 +376,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -435,7 +435,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -500,7 +500,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Jsr305NullabilityWarnings { @Test public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -509,7 +509,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Migration { @Test public void testAllFilesPresentInMigration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -574,7 +574,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -591,7 +591,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Java8Tests { @Test public void testAllFilesPresentInJava8Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -618,7 +618,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Jspecify { @Test public void testAllFilesPresentInJspecify() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -627,7 +627,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class StrictMode { @Test public void testAllFilesPresentInStrictMode() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -636,48 +636,24 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt"); } - @Test - @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") - public void testAnnotatedBoundsOfWildcard_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt"); - } - @Test @TestMetadata("Captured.kt") public void testCaptured() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.kt"); } - @Test - @TestMetadata("Captured.fir.kt") - public void testCaptured_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.kt"); - } - @Test @TestMetadata("Defaults.kt") public void testDefaults() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt"); } - @Test - @TestMetadata("Defaults.fir.kt") - public void testDefaults_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt"); - } - @Test @TestMetadata("IgnoreAnnotations.kt") public void testIgnoreAnnotations() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt"); } - @Test - @TestMetadata("IgnoreAnnotations.fir.kt") - public void testIgnoreAnnotations_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt"); - } - @Test @TestMetadata("kt47396.kt") public void testKt47396() throws Exception { @@ -702,83 +678,41 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt"); } - @Test - @TestMetadata("NonPlatformTypeParameter.fir.kt") - public void testNonPlatformTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt"); - } - @Test @TestMetadata("NullnessUnspecifiedTypeParameter.kt") public void testNullnessUnspecifiedTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt"); } - @Test - @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") - public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt"); - } - @Test @TestMetadata("SelfType.kt") public void testSelfType() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt"); } - @Test - @TestMetadata("SelfType.fir.kt") - public void testSelfType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt"); - } - @Test @TestMetadata("Simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt"); } - @Test - @TestMetadata("Simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt"); - } - @Test @TestMetadata("TypeArgumentsFromParameterBounds.kt") public void testTypeArgumentsFromParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt"); } - @Test - @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") - public void testTypeArgumentsFromParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt"); - } - @Test @TestMetadata("TypeParameterBounds.kt") public void testTypeParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt"); } - @Test - @TestMetadata("TypeParameterBounds.fir.kt") - public void testTypeParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt"); - } - @Test @TestMetadata("WildcardsWithDefault.kt") public void testWildcardsWithDefault() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt"); } - - @Test - @TestMetadata("WildcardsWithDefault.fir.kt") - public void testWildcardsWithDefault_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt"); - } } @Nested @@ -787,7 +721,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class WarnMode { @Test public void testAllFilesPresentInWarnMode() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -796,48 +730,24 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt"); } - @Test - @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") - public void testAnnotatedBoundsOfWildcard_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt"); - } - @Test @TestMetadata("Captured.kt") public void testCaptured() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.kt"); } - @Test - @TestMetadata("Captured.fir.kt") - public void testCaptured_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.kt"); - } - @Test @TestMetadata("Defaults.kt") public void testDefaults() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt"); } - @Test - @TestMetadata("Defaults.fir.kt") - public void testDefaults_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt"); - } - @Test @TestMetadata("IgnoreAnnotations.kt") public void testIgnoreAnnotations() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt"); } - @Test - @TestMetadata("IgnoreAnnotations.fir.kt") - public void testIgnoreAnnotations_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt"); - } - @Test @TestMetadata("kt47899.kt") public void testKt47899() throws Exception { @@ -850,83 +760,41 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt"); } - @Test - @TestMetadata("NonPlatformTypeParameter.fir.kt") - public void testNonPlatformTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt"); - } - @Test @TestMetadata("NullnessUnspecifiedTypeParameter.kt") public void testNullnessUnspecifiedTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt"); } - @Test - @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") - public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt"); - } - @Test @TestMetadata("SelfType.kt") public void testSelfType() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt"); } - @Test - @TestMetadata("SelfType.fir.kt") - public void testSelfType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt"); - } - @Test @TestMetadata("Simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt"); } - @Test - @TestMetadata("Simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt"); - } - @Test @TestMetadata("TypeArgumentsFromParameterBounds.kt") public void testTypeArgumentsFromParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt"); } - @Test - @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") - public void testTypeArgumentsFromParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt"); - } - @Test @TestMetadata("TypeParameterBounds.kt") public void testTypeParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt"); } - @Test - @TestMetadata("TypeParameterBounds.fir.kt") - public void testTypeParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt"); - } - @Test @TestMetadata("WildcardsWithDefault.kt") public void testWildcardsWithDefault() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt"); } - - @Test - @TestMetadata("WildcardsWithDefault.fir.kt") - public void testWildcardsWithDefault_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt"); - } } } @@ -936,7 +804,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -976,7 +844,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Misc { @Test public void testAllFilesPresentInMisc() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -985,12 +853,6 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.kt"); } - @Test - @TestMetadata("annotatedTypeArguments.fir.kt") - public void testAnnotatedTypeArguments_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.kt"); - } - @Test @TestMetadata("classTypeParameterBound.kt") public void testClassTypeParameterBound() throws Exception { @@ -1003,66 +865,30 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.kt"); } - @Test - @TestMetadata("classTypeParameterBoundWithWarnings.fir.kt") - public void testClassTypeParameterBoundWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("classTypeParameterBound.fir.kt") - public void testClassTypeParameterBound_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt"); - } - @Test @TestMetadata("enhancedRecursiveStarProjection.kt") public void testEnhancedRecursiveStarProjection() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.kt"); } - @Test - @TestMetadata("enhancedRecursiveStarProjection.fir.kt") - public void testEnhancedRecursiveStarProjection_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.fir.kt"); - } - @Test @TestMetadata("methodWithTypeParameter.kt") public void testMethodWithTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.kt"); } - @Test - @TestMetadata("methodWithTypeParameter.fir.kt") - public void testMethodWithTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.kt"); - } - @Test @TestMetadata("notNullVarargsOverrides.kt") public void testNotNullVarargsOverrides() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.kt"); } - @Test - @TestMetadata("notNullVarargsOverrides.fir.kt") - public void testNotNullVarargsOverrides_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt"); - } - @Test @TestMetadata("nullableVarargsOverrides.kt") public void testNullableVarargsOverrides() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.kt"); } - @Test - @TestMetadata("nullableVarargsOverrides.fir.kt") - public void testNullableVarargsOverrides_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt"); - } - @Test @TestMetadata("returnType.kt") public void testReturnType() throws Exception { @@ -1075,54 +901,24 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.kt"); } - @Test - @TestMetadata("returnTypeDifferentConstructor.fir.kt") - public void testReturnTypeDifferentConstructor_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.kt"); - } - @Test @TestMetadata("returnTypeOverrideInKotlin.kt") public void testReturnTypeOverrideInKotlin() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.kt"); } - @Test - @TestMetadata("returnTypeOverrideInKotlin.fir.kt") - public void testReturnTypeOverrideInKotlin_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.kt"); - } - @Test @TestMetadata("returnTypeWithWarnings.kt") public void testReturnTypeWithWarnings() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.kt"); } - @Test - @TestMetadata("returnTypeWithWarnings.fir.kt") - public void testReturnTypeWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("returnType.fir.kt") - public void testReturnType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt"); - } - @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.kt"); } - @Test - @TestMetadata("simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.kt"); - } - @Test @TestMetadata("useTypeParameterAnnotationToEnhanceItsUsages.kt") public void testUseTypeParameterAnnotationToEnhanceItsUsages() throws Exception { @@ -1141,18 +937,6 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.kt"); } - @Test - @TestMetadata("valueParameterWithWarnings.fir.kt") - public void testValueParameterWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("valueParameter.fir.kt") - public void testValueParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt"); - } - @Test @TestMetadata("warningsBasedOnEnhancedBasedType.kt") public void testWarningsBasedOnEnhancedBasedType() throws Exception { @@ -1167,7 +951,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Java9Tests { @Test public void testAllFilesPresentInJava9Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1176,7 +960,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Jspecify { @Test public void testAllFilesPresentInJspecify() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1185,7 +969,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class ModuleAnnotations { @Test public void testAllFilesPresentInModuleAnnotations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1194,7 +978,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Strict { @Test public void testAllFilesPresentInStrict() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/strict"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/strict"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -1270,7 +1054,7 @@ public class ForeignAnnotationsCompiledJavaTestGenerated extends AbstractForeign public class Warn { @Test public void testAllFilesPresentInWarn() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/warn"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/warn"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated.java index bb718c9bbea..4421a892e14 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated.java @@ -23,7 +23,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Tests { @Test public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -140,7 +140,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -179,7 +179,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Ignore { @Test public void testAllFilesPresentInIgnore() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -195,7 +195,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class NullabilityWarnings { @Test public void testAllFilesPresentInNullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -246,7 +246,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class FromPlatformTypes { @Test public void testAllFilesPresentInFromPlatformTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -376,7 +376,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -435,7 +435,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -500,7 +500,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Jsr305NullabilityWarnings { @Test public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -509,7 +509,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Migration { @Test public void testAllFilesPresentInMigration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -574,7 +574,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -591,7 +591,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Java8Tests { @Test public void testAllFilesPresentInJava8Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -618,7 +618,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Jspecify { @Test public void testAllFilesPresentInJspecify() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -627,7 +627,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class StrictMode { @Test public void testAllFilesPresentInStrictMode() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -636,48 +636,24 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt"); } - @Test - @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") - public void testAnnotatedBoundsOfWildcard_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt"); - } - @Test @TestMetadata("Captured.kt") public void testCaptured() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.kt"); } - @Test - @TestMetadata("Captured.fir.kt") - public void testCaptured_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.kt"); - } - @Test @TestMetadata("Defaults.kt") public void testDefaults() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt"); } - @Test - @TestMetadata("Defaults.fir.kt") - public void testDefaults_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt"); - } - @Test @TestMetadata("IgnoreAnnotations.kt") public void testIgnoreAnnotations() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt"); } - @Test - @TestMetadata("IgnoreAnnotations.fir.kt") - public void testIgnoreAnnotations_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt"); - } - @Test @TestMetadata("kt47396.kt") public void testKt47396() throws Exception { @@ -702,83 +678,41 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt"); } - @Test - @TestMetadata("NonPlatformTypeParameter.fir.kt") - public void testNonPlatformTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt"); - } - @Test @TestMetadata("NullnessUnspecifiedTypeParameter.kt") public void testNullnessUnspecifiedTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt"); } - @Test - @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") - public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt"); - } - @Test @TestMetadata("SelfType.kt") public void testSelfType() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt"); } - @Test - @TestMetadata("SelfType.fir.kt") - public void testSelfType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt"); - } - @Test @TestMetadata("Simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt"); } - @Test - @TestMetadata("Simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt"); - } - @Test @TestMetadata("TypeArgumentsFromParameterBounds.kt") public void testTypeArgumentsFromParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt"); } - @Test - @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") - public void testTypeArgumentsFromParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt"); - } - @Test @TestMetadata("TypeParameterBounds.kt") public void testTypeParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt"); } - @Test - @TestMetadata("TypeParameterBounds.fir.kt") - public void testTypeParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt"); - } - @Test @TestMetadata("WildcardsWithDefault.kt") public void testWildcardsWithDefault() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt"); } - - @Test - @TestMetadata("WildcardsWithDefault.fir.kt") - public void testWildcardsWithDefault_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt"); - } } @Nested @@ -787,7 +721,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class WarnMode { @Test public void testAllFilesPresentInWarnMode() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -796,48 +730,24 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt"); } - @Test - @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") - public void testAnnotatedBoundsOfWildcard_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt"); - } - @Test @TestMetadata("Captured.kt") public void testCaptured() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.kt"); } - @Test - @TestMetadata("Captured.fir.kt") - public void testCaptured_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.kt"); - } - @Test @TestMetadata("Defaults.kt") public void testDefaults() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt"); } - @Test - @TestMetadata("Defaults.fir.kt") - public void testDefaults_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt"); - } - @Test @TestMetadata("IgnoreAnnotations.kt") public void testIgnoreAnnotations() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt"); } - @Test - @TestMetadata("IgnoreAnnotations.fir.kt") - public void testIgnoreAnnotations_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt"); - } - @Test @TestMetadata("kt47899.kt") public void testKt47899() throws Exception { @@ -850,83 +760,41 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt"); } - @Test - @TestMetadata("NonPlatformTypeParameter.fir.kt") - public void testNonPlatformTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt"); - } - @Test @TestMetadata("NullnessUnspecifiedTypeParameter.kt") public void testNullnessUnspecifiedTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt"); } - @Test - @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") - public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt"); - } - @Test @TestMetadata("SelfType.kt") public void testSelfType() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt"); } - @Test - @TestMetadata("SelfType.fir.kt") - public void testSelfType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt"); - } - @Test @TestMetadata("Simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt"); } - @Test - @TestMetadata("Simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt"); - } - @Test @TestMetadata("TypeArgumentsFromParameterBounds.kt") public void testTypeArgumentsFromParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt"); } - @Test - @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") - public void testTypeArgumentsFromParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt"); - } - @Test @TestMetadata("TypeParameterBounds.kt") public void testTypeParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt"); } - @Test - @TestMetadata("TypeParameterBounds.fir.kt") - public void testTypeParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt"); - } - @Test @TestMetadata("WildcardsWithDefault.kt") public void testWildcardsWithDefault() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt"); } - - @Test - @TestMetadata("WildcardsWithDefault.fir.kt") - public void testWildcardsWithDefault_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt"); - } } } @@ -936,7 +804,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -976,7 +844,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Misc { @Test public void testAllFilesPresentInMisc() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -985,12 +853,6 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.kt"); } - @Test - @TestMetadata("annotatedTypeArguments.fir.kt") - public void testAnnotatedTypeArguments_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.kt"); - } - @Test @TestMetadata("classTypeParameterBound.kt") public void testClassTypeParameterBound() throws Exception { @@ -1003,66 +865,30 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.kt"); } - @Test - @TestMetadata("classTypeParameterBoundWithWarnings.fir.kt") - public void testClassTypeParameterBoundWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("classTypeParameterBound.fir.kt") - public void testClassTypeParameterBound_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt"); - } - @Test @TestMetadata("enhancedRecursiveStarProjection.kt") public void testEnhancedRecursiveStarProjection() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.kt"); } - @Test - @TestMetadata("enhancedRecursiveStarProjection.fir.kt") - public void testEnhancedRecursiveStarProjection_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.fir.kt"); - } - @Test @TestMetadata("methodWithTypeParameter.kt") public void testMethodWithTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.kt"); } - @Test - @TestMetadata("methodWithTypeParameter.fir.kt") - public void testMethodWithTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.kt"); - } - @Test @TestMetadata("notNullVarargsOverrides.kt") public void testNotNullVarargsOverrides() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.kt"); } - @Test - @TestMetadata("notNullVarargsOverrides.fir.kt") - public void testNotNullVarargsOverrides_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt"); - } - @Test @TestMetadata("nullableVarargsOverrides.kt") public void testNullableVarargsOverrides() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.kt"); } - @Test - @TestMetadata("nullableVarargsOverrides.fir.kt") - public void testNullableVarargsOverrides_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt"); - } - @Test @TestMetadata("returnType.kt") public void testReturnType() throws Exception { @@ -1075,54 +901,24 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.kt"); } - @Test - @TestMetadata("returnTypeDifferentConstructor.fir.kt") - public void testReturnTypeDifferentConstructor_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.kt"); - } - @Test @TestMetadata("returnTypeOverrideInKotlin.kt") public void testReturnTypeOverrideInKotlin() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.kt"); } - @Test - @TestMetadata("returnTypeOverrideInKotlin.fir.kt") - public void testReturnTypeOverrideInKotlin_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.kt"); - } - @Test @TestMetadata("returnTypeWithWarnings.kt") public void testReturnTypeWithWarnings() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.kt"); } - @Test - @TestMetadata("returnTypeWithWarnings.fir.kt") - public void testReturnTypeWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("returnType.fir.kt") - public void testReturnType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt"); - } - @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.kt"); } - @Test - @TestMetadata("simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.kt"); - } - @Test @TestMetadata("useTypeParameterAnnotationToEnhanceItsUsages.kt") public void testUseTypeParameterAnnotationToEnhanceItsUsages() throws Exception { @@ -1141,18 +937,6 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.kt"); } - @Test - @TestMetadata("valueParameterWithWarnings.fir.kt") - public void testValueParameterWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("valueParameter.fir.kt") - public void testValueParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt"); - } - @Test @TestMetadata("warningsBasedOnEnhancedBasedType.kt") public void testWarningsBasedOnEnhancedBasedType() throws Exception { @@ -1167,7 +951,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Java9Tests { @Test public void testAllFilesPresentInJava9Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1176,7 +960,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Jspecify { @Test public void testAllFilesPresentInJspecify() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1185,7 +969,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class ModuleAnnotations { @Test public void testAllFilesPresentInModuleAnnotations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1194,7 +978,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Strict { @Test public void testAllFilesPresentInStrict() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/strict"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/strict"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -1270,7 +1054,7 @@ public class ForeignAnnotationsCompiledJavaWithPsiClassReadingTestGenerated exte public class Warn { @Test public void testAllFilesPresentInWarn() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/warn"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/warn"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsSourceJavaTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsSourceJavaTestGenerated.java index 5da532b4504..f2e81315d5a 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsSourceJavaTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsSourceJavaTestGenerated.java @@ -23,7 +23,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Tests { @Test public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -140,7 +140,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -179,7 +179,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Ignore { @Test public void testAllFilesPresentInIgnore() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -195,7 +195,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class NullabilityWarnings { @Test public void testAllFilesPresentInNullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -246,7 +246,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class FromPlatformTypes { @Test public void testAllFilesPresentInFromPlatformTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -376,7 +376,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -435,7 +435,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -500,7 +500,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Jsr305NullabilityWarnings { @Test public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -509,7 +509,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Migration { @Test public void testAllFilesPresentInMigration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -574,7 +574,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -591,7 +591,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Java8Tests { @Test public void testAllFilesPresentInJava8Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -618,7 +618,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Jspecify { @Test public void testAllFilesPresentInJspecify() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -627,7 +627,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class StrictMode { @Test public void testAllFilesPresentInStrictMode() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -636,48 +636,24 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt"); } - @Test - @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") - public void testAnnotatedBoundsOfWildcard_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt"); - } - @Test @TestMetadata("Captured.kt") public void testCaptured() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.kt"); } - @Test - @TestMetadata("Captured.fir.kt") - public void testCaptured_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Captured.fir.kt"); - } - @Test @TestMetadata("Defaults.kt") public void testDefaults() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt"); } - @Test - @TestMetadata("Defaults.fir.kt") - public void testDefaults_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt"); - } - @Test @TestMetadata("IgnoreAnnotations.kt") public void testIgnoreAnnotations() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt"); } - @Test - @TestMetadata("IgnoreAnnotations.fir.kt") - public void testIgnoreAnnotations_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt"); - } - @Test @TestMetadata("kt47396.kt") public void testKt47396() throws Exception { @@ -702,83 +678,41 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt"); } - @Test - @TestMetadata("NonPlatformTypeParameter.fir.kt") - public void testNonPlatformTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt"); - } - @Test @TestMetadata("NullnessUnspecifiedTypeParameter.kt") public void testNullnessUnspecifiedTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt"); } - @Test - @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") - public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt"); - } - @Test @TestMetadata("SelfType.kt") public void testSelfType() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt"); } - @Test - @TestMetadata("SelfType.fir.kt") - public void testSelfType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt"); - } - @Test @TestMetadata("Simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt"); } - @Test - @TestMetadata("Simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt"); - } - @Test @TestMetadata("TypeArgumentsFromParameterBounds.kt") public void testTypeArgumentsFromParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt"); } - @Test - @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") - public void testTypeArgumentsFromParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt"); - } - @Test @TestMetadata("TypeParameterBounds.kt") public void testTypeParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt"); } - @Test - @TestMetadata("TypeParameterBounds.fir.kt") - public void testTypeParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt"); - } - @Test @TestMetadata("WildcardsWithDefault.kt") public void testWildcardsWithDefault() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt"); } - - @Test - @TestMetadata("WildcardsWithDefault.fir.kt") - public void testWildcardsWithDefault_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt"); - } } @Nested @@ -787,7 +721,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class WarnMode { @Test public void testAllFilesPresentInWarnMode() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -796,48 +730,24 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt"); } - @Test - @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") - public void testAnnotatedBoundsOfWildcard_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt"); - } - @Test @TestMetadata("Captured.kt") public void testCaptured() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.kt"); } - @Test - @TestMetadata("Captured.fir.kt") - public void testCaptured_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Captured.fir.kt"); - } - @Test @TestMetadata("Defaults.kt") public void testDefaults() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt"); } - @Test - @TestMetadata("Defaults.fir.kt") - public void testDefaults_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt"); - } - @Test @TestMetadata("IgnoreAnnotations.kt") public void testIgnoreAnnotations() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt"); } - @Test - @TestMetadata("IgnoreAnnotations.fir.kt") - public void testIgnoreAnnotations_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt"); - } - @Test @TestMetadata("kt47899.kt") public void testKt47899() throws Exception { @@ -850,83 +760,41 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt"); } - @Test - @TestMetadata("NonPlatformTypeParameter.fir.kt") - public void testNonPlatformTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt"); - } - @Test @TestMetadata("NullnessUnspecifiedTypeParameter.kt") public void testNullnessUnspecifiedTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt"); } - @Test - @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") - public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt"); - } - @Test @TestMetadata("SelfType.kt") public void testSelfType() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt"); } - @Test - @TestMetadata("SelfType.fir.kt") - public void testSelfType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt"); - } - @Test @TestMetadata("Simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt"); } - @Test - @TestMetadata("Simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt"); - } - @Test @TestMetadata("TypeArgumentsFromParameterBounds.kt") public void testTypeArgumentsFromParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt"); } - @Test - @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") - public void testTypeArgumentsFromParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt"); - } - @Test @TestMetadata("TypeParameterBounds.kt") public void testTypeParameterBounds() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt"); } - @Test - @TestMetadata("TypeParameterBounds.fir.kt") - public void testTypeParameterBounds_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt"); - } - @Test @TestMetadata("WildcardsWithDefault.kt") public void testWildcardsWithDefault() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt"); } - - @Test - @TestMetadata("WildcardsWithDefault.fir.kt") - public void testWildcardsWithDefault_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt"); - } } } @@ -936,7 +804,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -976,7 +844,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Misc { @Test public void testAllFilesPresentInMisc() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -985,12 +853,6 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.kt"); } - @Test - @TestMetadata("annotatedTypeArguments.fir.kt") - public void testAnnotatedTypeArguments_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/annotatedTypeArguments.fir.kt"); - } - @Test @TestMetadata("classTypeParameterBound.kt") public void testClassTypeParameterBound() throws Exception { @@ -1003,66 +865,30 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.kt"); } - @Test - @TestMetadata("classTypeParameterBoundWithWarnings.fir.kt") - public void testClassTypeParameterBoundWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("classTypeParameterBound.fir.kt") - public void testClassTypeParameterBound_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt"); - } - @Test @TestMetadata("enhancedRecursiveStarProjection.kt") public void testEnhancedRecursiveStarProjection() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.kt"); } - @Test - @TestMetadata("enhancedRecursiveStarProjection.fir.kt") - public void testEnhancedRecursiveStarProjection_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/enhancedRecursiveStarProjection.fir.kt"); - } - @Test @TestMetadata("methodWithTypeParameter.kt") public void testMethodWithTypeParameter() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.kt"); } - @Test - @TestMetadata("methodWithTypeParameter.fir.kt") - public void testMethodWithTypeParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/methodWithTypeParameter.fir.kt"); - } - @Test @TestMetadata("notNullVarargsOverrides.kt") public void testNotNullVarargsOverrides() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.kt"); } - @Test - @TestMetadata("notNullVarargsOverrides.fir.kt") - public void testNotNullVarargsOverrides_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt"); - } - @Test @TestMetadata("nullableVarargsOverrides.kt") public void testNullableVarargsOverrides() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.kt"); } - @Test - @TestMetadata("nullableVarargsOverrides.fir.kt") - public void testNullableVarargsOverrides_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt"); - } - @Test @TestMetadata("returnType.kt") public void testReturnType() throws Exception { @@ -1075,54 +901,24 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.kt"); } - @Test - @TestMetadata("returnTypeDifferentConstructor.fir.kt") - public void testReturnTypeDifferentConstructor_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeDifferentConstructor.fir.kt"); - } - @Test @TestMetadata("returnTypeOverrideInKotlin.kt") public void testReturnTypeOverrideInKotlin() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.kt"); } - @Test - @TestMetadata("returnTypeOverrideInKotlin.fir.kt") - public void testReturnTypeOverrideInKotlin_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeOverrideInKotlin.fir.kt"); - } - @Test @TestMetadata("returnTypeWithWarnings.kt") public void testReturnTypeWithWarnings() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.kt"); } - @Test - @TestMetadata("returnTypeWithWarnings.fir.kt") - public void testReturnTypeWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("returnType.fir.kt") - public void testReturnType_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt"); - } - @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.kt"); } - @Test - @TestMetadata("simple.fir.kt") - public void testSimple_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/simple.fir.kt"); - } - @Test @TestMetadata("useTypeParameterAnnotationToEnhanceItsUsages.kt") public void testUseTypeParameterAnnotationToEnhanceItsUsages() throws Exception { @@ -1141,18 +937,6 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.kt"); } - @Test - @TestMetadata("valueParameterWithWarnings.fir.kt") - public void testValueParameterWithWarnings_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt"); - } - - @Test - @TestMetadata("valueParameter.fir.kt") - public void testValueParameter_fir() throws Exception { - runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt"); - } - @Test @TestMetadata("warningsBasedOnEnhancedBasedType.kt") public void testWarningsBasedOnEnhancedBasedType() throws Exception { @@ -1167,7 +951,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Java9Tests { @Test public void testAllFilesPresentInJava9Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1176,7 +960,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Jspecify { @Test public void testAllFilesPresentInJspecify() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1185,7 +969,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class ModuleAnnotations { @Test public void testAllFilesPresentInModuleAnnotations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -1194,7 +978,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Strict { @Test public void testAllFilesPresentInStrict() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/strict"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/strict"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test @@ -1270,7 +1054,7 @@ public class ForeignAnnotationsSourceJavaTestGenerated extends AbstractForeignAn public class Warn { @Test public void testAllFilesPresentInWarn() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/warn"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/jspecify/moduleAnnotations/warn"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Test diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index ef396bddc21..dd2f4ceb74c 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -50,21 +50,21 @@ fun generateJUnit5CompilerTests(args: Array) { } testClass { - model("diagnostics/foreignAnnotationsTests/tests") - model("diagnostics/foreignAnnotationsTests/java8Tests") - model("diagnostics/foreignAnnotationsTests/java9Tests") + model("diagnostics/foreignAnnotationsTests/tests", excludedPattern = excludedFirTestdataPattern) + model("diagnostics/foreignAnnotationsTests/java8Tests", excludedPattern = excludedFirTestdataPattern) + model("diagnostics/foreignAnnotationsTests/java9Tests", excludedPattern = excludedFirTestdataPattern) } testClass { - model("diagnostics/foreignAnnotationsTests/tests") - model("diagnostics/foreignAnnotationsTests/java8Tests") - model("diagnostics/foreignAnnotationsTests/java9Tests") + model("diagnostics/foreignAnnotationsTests/tests", excludedPattern = excludedFirTestdataPattern) + model("diagnostics/foreignAnnotationsTests/java8Tests", excludedPattern = excludedFirTestdataPattern) + model("diagnostics/foreignAnnotationsTests/java9Tests", excludedPattern = excludedFirTestdataPattern) } testClass { - model("diagnostics/foreignAnnotationsTests/tests") - model("diagnostics/foreignAnnotationsTests/java8Tests",) - model("diagnostics/foreignAnnotationsTests/java9Tests") + model("diagnostics/foreignAnnotationsTests/tests", excludedPattern = excludedFirTestdataPattern) + model("diagnostics/foreignAnnotationsTests/java8Tests", excludedPattern = excludedFirTestdataPattern) + model("diagnostics/foreignAnnotationsTests/java9Tests", excludedPattern = excludedFirTestdataPattern) } testClass {