diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt index 63de62cdd61..9791fd8aaa3 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/jsr305/overrideWithTypeUseInClasspathWithArray.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/overrideWithTypeUseInClasspathWithArray.kt index 6ad65a200f9..aec1f7b8505 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/overrideWithTypeUseInClasspathWithArray.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/overrideWithTypeUseInClasspathWithArray.kt @@ -2,6 +2,7 @@ // SOURCE_RETENTION_ANNOTATIONS // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // JSR305_GLOBAL_REPORT: strict +// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode // FILE: spr/Nullable.java package spr; diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.txt index c0cc78617dd..e93bffc23b6 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/useTypeParameterAnnotationToEnhanceItsUsages.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/useTypeParameterAnnotationToEnhanceItsUsages.kt index 7ff2a020b7b..8c273d4ed7f 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/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index fa083a975c1..1bc95ea9904 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -183,19 +183,6 @@ enum class LanguageFeature( // 1.6 - /* - * Improvements include the following: - * - taking into account for type enhancement freshly supported type use annotations: KT-11454 - * - use annotations in the type parameter position to enhance corresponding types: KT-11454 - * - proper support of the type enhancement of the annotated java arrays: KT-24392 - * - proper support of the type enhancement of the annotated java varargs' elements: KT-18768 - * - type enhancement based on annotated bounds of type parameters - * - type enhancement within type arguments of the base classes and interfaces - * - support type enhancement based on type use annotations on java fields - * - preference of a type use annotation to annotation of another type: KT-24392 - * (if @NotNull has TYPE_USE and METHOD target, then `@NotNull Integer []` -> `Array..Array?` instead of `Array..Array`) - */ - TypeEnhancementImprovementsInStrictMode(KOTLIN_1_6), ProhibitJvmFieldOnOverrideFromInterfaceInPrimaryConstructor(KOTLIN_1_6, kind = BUG_FIX), PrivateInFileEffectiveVisibility(KOTLIN_1_6, kind = BUG_FIX), ProhibitSelfCallsInNestedObjects(KOTLIN_1_6, kind = BUG_FIX), @@ -217,6 +204,19 @@ enum class LanguageFeature( // 1.7 + /* + * Improvements include the following: + * - taking into account for type enhancement freshly supported type use annotations: KT-11454 + * - use annotations in the type parameter position to enhance corresponding types: KT-11454 + * - proper support of the type enhancement of the annotated java arrays: KT-24392 + * - proper support of the type enhancement of the annotated java varargs' elements: KT-18768 + * - type enhancement based on annotated bounds of type parameters + * - type enhancement within type arguments of the base classes and interfaces + * - support type enhancement based on type use annotations on java fields + * - preference of a type use annotation to annotation of another type: KT-24392 + * (if @NotNull has TYPE_USE and METHOD target, then `@NotNull Integer []` -> `Array..Array?` instead of `Array..Array`) + */ + TypeEnhancementImprovementsInStrictMode(KOTLIN_1_7), ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated(KOTLIN_1_7, kind = BUG_FIX), OptInRelease(KOTLIN_1_7), ProhibitNonExhaustiveWhenOnAlgebraicTypes(KOTLIN_1_7, kind = BUG_FIX),