From f84adcb37888aa3deb4f9610a7f0bf75d4546c21 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Thu, 22 Jul 2021 11:29:46 +0300 Subject: [PATCH] [FE 1.0] Fix some foreign annotation tests --- .../NullnessUnspecifiedTypeParameter.fir.kt | 8 +++----- .../strictMode/NullnessUnspecifiedTypeParameter.kt | 8 +++----- .../java8Tests/jspecify/strictMode/SelfType.fir.kt | 6 ++---- .../java8Tests/jspecify/strictMode/SelfType.fir.txt | 2 +- .../java8Tests/jspecify/strictMode/SelfType.kt | 6 ++---- .../java8Tests/jspecify/strictMode/SelfType.txt | 2 +- .../jspecify/strictMode/TypeParameterBounds.fir.kt | 3 +-- .../jspecify/strictMode/TypeParameterBounds.kt | 3 +-- .../jspecify/strictMode/WildcardsWithDefault.fir.txt | 4 ++-- .../jspecify/strictMode/WildcardsWithDefault.txt | 4 ++-- .../warnMode/NullnessUnspecifiedTypeParameter.fir.kt | 3 +-- .../warnMode/NullnessUnspecifiedTypeParameter.kt | 3 +-- .../java8Tests/jspecify/warnMode/SelfType.fir.kt | 6 ++++-- .../java8Tests/jspecify/warnMode/SelfType.kt | 6 ++++-- .../jspecify/warnMode/TypeParameterBounds.fir.kt | 11 +++++------ .../jspecify/warnMode/TypeParameterBounds.kt | 11 +++++------ .../misc/classTypeParameterBoundWithWarnings.fir.kt | 2 +- .../misc/classTypeParameterBoundWithWarnings.kt | 2 +- .../java8Tests/misc/notNullVarargsOverrides.fir.txt | 4 ++-- .../java8Tests/misc/notNullVarargsOverrides.txt | 4 ++-- .../java8Tests/misc/returnTypeWithWarnings.fir.kt | 2 +- .../java8Tests/misc/returnTypeWithWarnings.kt | 2 +- .../useTypeParameterAnnotationToEnhanceItsUsages.kt | 2 +- .../java8Tests/misc/valueParameterWithWarnings.fir.kt | 2 +- .../java8Tests/misc/valueParameterWithWarnings.kt | 2 +- .../misc/warningsBasedOnEnhancedBasedType.kt | 1 + 26 files changed, 50 insertions(+), 59 deletions(-) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt index a015835f3be..125c8aeea6d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt @@ -20,8 +20,7 @@ fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeP a1.foo(null) a1.foo(1) - // jspecify_nullness_mismatch - a2.foo(null) + a2.foo(null) a2.foo(1) // jspecify_nullness_mismatch, jspecify_nullness_mismatch @@ -30,9 +29,8 @@ fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeP 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(null, null) + a2.bar(x, null) a2.bar(x, 1) } diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt index b33dd528a76..b641c49fd88 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt @@ -20,8 +20,7 @@ fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeP a1.foo(null) a1.foo(1) - // jspecify_nullness_mismatch - a2.foo(null) + a2.foo(null) a2.foo(1) // jspecify_nullness_mismatch, jspecify_nullness_mismatch @@ -30,9 +29,8 @@ fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeP 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(null, null) + a2.bar(x, null) a2.bar(x, 1) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt index 98ac27083e7..edb34a9cc8f 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt @@ -42,8 +42,7 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ak.foo(null) - // jspecify_nullness_mismatch - akn.foo(null) + akn.foo(null) bk.foo(bk) // jspecify_nullness_mismatch @@ -53,6 +52,5 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ck.foo(null) - // jspecify_nullness_mismatch - ckn.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 index 772fe2f87b7..9fb5177f58d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt @@ -13,7 +13,7 @@ public open class AK : SelfType { 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 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 } diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt index 2dba93d8f0a..4b50008741d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt @@ -42,8 +42,7 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ak.foo(null) - // jspecify_nullness_mismatch - akn.foo(null) + akn.foo(null) bk.foo(bk) // jspecify_nullness_mismatch @@ -53,6 +52,5 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ck.foo(null) - // jspecify_nullness_mismatch - ckn.foo(null) + ckn.foo(null) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt index 772fe2f87b7..9fb5177f58d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt @@ -13,7 +13,7 @@ public open class AK : SelfType { 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 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 } diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt index 0453bdfe237..468edc2c8cc 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt @@ -33,8 +33,7 @@ fun main(a1: A<Any?>, a2: A, b1: B<< a2.bar<T?>(null) a2.bar(x) - // jspecify_nullness_mismatch - b1.foo(null) + b1.foo(null) // jspecify_nullness_mismatch, jspecify_nullness_mismatch b1.bar<T?>(null) b1.bar(x) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt index 952a722b241..bf5f7238763 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt @@ -33,8 +33,7 @@ fun main(a1: A<Any?>, a2: A, b1: B<< a2.bar<T?>(null) a2.bar(x) - // jspecify_nullness_mismatch - b1.foo(null) + b1.foo(null) // jspecify_nullness_mismatch, jspecify_nullness_mismatch b1.bar<T?>(null) b1.bar(x) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt index b4eca666fff..05e1101e53b 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt @@ -2,8 +2,8 @@ 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 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 diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt index bc95e1d8837..6d5a373a940 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt @@ -2,8 +2,8 @@ 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 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 diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt index efe26f393be..aab0423ec00 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt @@ -13,8 +13,7 @@ public class NullnessUnspecifiedTypeParameter { public class Test {} // FILE: main.kt -// jspecify_nullness_mismatch -fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit { +fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter, x: Test): Unit { // jspecify_nullness_mismatch a1.foo(null) a1.foo(1) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt index a3154623f08..5a82f331616 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt @@ -13,8 +13,7 @@ public class NullnessUnspecifiedTypeParameter { public class Test {} // FILE: main.kt -// jspecify_nullness_mismatch -fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit { +fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter, x: Test): Unit { // jspecify_nullness_mismatch a1.foo(null) a1.foo(1) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt index b59b7e1a96f..a979e29ec58 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt @@ -43,7 +43,8 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ak.foo(null) - akn.foo(null) + // jspecify_nullness_mismatch + akn.foo(null) bk.foo(bk) // jspecify_nullness_mismatch @@ -53,5 +54,6 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ck.foo(null) - ckn.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.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt index e2b7313dbee..7d68d1405f4 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt @@ -43,7 +43,8 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ak.foo(null) - akn.foo(null) // the corresponding warning/error is present on the Java side + // jspecify_nullness_mismatch + akn.foo(null) // the corresponding warning/error is present on the Java side bk.foo(bk) // jspecify_nullness_mismatch @@ -53,5 +54,6 @@ fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { // jspecify_nullness_mismatch ck.foo(null) - ckn.foo(null) // the corresponding warning/error is present on the Java side + // jspecify_nullness_mismatch + ckn.foo(null) // the corresponding warning/error is present on the Java side } \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt index c2aa20fbe18..c2e78d2288d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt @@ -20,27 +20,26 @@ public class B { 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 { +fun main(a1: A, a2: A, b1: B, b2: B, x: T): Unit { a1.foo(null) // jspecify_nullness_mismatch - a1.bar<T?>(null) + a1.bar(null) a1.bar(x) a2.foo(null) // jspecify_nullness_mismatch - a2.bar<T?>(null) + a2.bar(null) a2.bar(x) // jspecify_nullness_mismatch b1.foo(null) // jspecify_nullness_mismatch - b1.bar<T?>(null) + b1.bar(null) b1.bar(x) // jspecify_nullness_mismatch b2.foo(null) // jspecify_nullness_mismatch - b2.bar<T?>(null) + b2.bar(null) b2.bar(x) } diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt index bb1e8fa1275..b0c1ee44de6 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt @@ -20,27 +20,26 @@ public class B { 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 { +fun main(a1: A, a2: A, b1: B, b2: B, x: T): Unit { a1.foo(null) // jspecify_nullness_mismatch - a1.bar<T?>(null) + a1.bar(null) a1.bar(x) a2.foo(null) // jspecify_nullness_mismatch - a2.bar<T?>(null) + a2.bar(null) a2.bar(x) // jspecify_nullness_mismatch b1.foo(null) // jspecify_nullness_mismatch - b1.bar<T?>(null) + b1.bar(null) b1.bar(x) // jspecify_nullness_mismatch b2.foo(null) // jspecify_nullness_mismatch - b2.bar<T?>(null) + b2.bar(null) b2.bar(x) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt index 15821df9fb0..7ec7f0044d9 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // SKIP_TXT // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.kt index 15821df9fb0..7ec7f0044d9 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBoundWithWarnings.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // SKIP_TXT // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt index e93bffc23b6..c0cc78617dd 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.txt @@ -4,7 +4,7 @@ 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 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 } @@ -21,6 +21,6 @@ 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 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/notNullVarargsOverrides.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.txt index e93bffc23b6..c0cc78617dd 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.txt @@ -4,7 +4,7 @@ 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 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 } @@ -21,6 +21,6 @@ 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 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/returnTypeWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt index faca5e38107..d85017dfa9c 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode // !DIAGNOSTICS: -UNUSED_PARAMETER // SKIP_TXT // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.kt index 73c37ba246b..964446db49a 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode // !DIAGNOSTICS: -UNUSED_PARAMETER // SKIP_TXT // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/useTypeParameterAnnotationToEnhanceItsUsages.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/useTypeParameterAnnotationToEnhanceItsUsages.kt index 8c273d4ed7f..7ff2a020b7b 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/useTypeParameterAnnotationToEnhanceItsUsages.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/useTypeParameterAnnotationToEnhanceItsUsages.kt @@ -10,5 +10,5 @@ public interface MapLike<@org.jetbrains.annotations.NotNull K> { // FILE: main.kt fun test2(map : MapLike, x2: Int?) { - map.put(x2) + map.put(x2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt index 9667f9badcb..c55a0e3cdfb 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode // !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS // SKIP_TXT // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.kt index 9667f9badcb..c55a0e3cdfb 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated, -TypeEnhancementImprovementsInStrictMode // !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS // SKIP_TXT // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/warningsBasedOnEnhancedBasedType.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/warningsBasedOnEnhancedBasedType.kt index 07f858de200..57377a70b6d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/warningsBasedOnEnhancedBasedType.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/warningsBasedOnEnhancedBasedType.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: -TypeEnhancementImprovementsInStrictMode // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // SKIP_TXT // MUTE_FOR_PSI_CLASS_FILES_READING