From d34bd2e8c075340c13980cf57403aadc11a707bb Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Thu, 8 Dec 2022 12:20:32 +0100 Subject: [PATCH] Postpone ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated The main reason is a bug in deserialization(KT-55357) that doesn't allow to deserialize some binaries compiled with that feature enabled. While we might fix it in 1.8.0, it doesn't help because previous compilers, e.g. 1.7.0 still may break when using freshly recompiled libraries. Considering, that almost any meaningful fix might look unsafe for the almost released 1.8.0, we can't enable the feature even in 1.9, because 1.8.0 compilers wouldn't read those libraries anyway. So, effectively this feature will be only enabled in K2. ^KT-55357 Related ^KT-36770 Related --- .../org/jetbrains/kotlin/config/LanguageVersionSettings.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 686269ba784..2b08b3e8138 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -239,7 +239,6 @@ enum class LanguageFeature( // 1.8 DontLoseDiagnosticsDuringOverloadResolutionByReturnType(KOTLIN_1_8), - ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated(KOTLIN_1_8, kind = BUG_FIX), // KT-36770 ProhibitConfusingSyntaxInWhenBranches(KOTLIN_1_8, kind = BUG_FIX), // KT-48385 UseConsistentRulesForPrivateConstructorsOfSealedClasses(sinceVersion = KOTLIN_1_8, kind = BUG_FIX), // KT-44866 ProgressionsChangingResolve(KOTLIN_1_8), // KT-49276 @@ -285,6 +284,11 @@ enum class LanguageFeature( ValueClassesSecondaryConstructorWithBody(sinceVersion = KOTLIN_1_9, kind = UNSTABLE_FEATURE), // KT-55333 + // This feature effectively might be removed because we decided to disable it until K2 and there it will be unconditionally enabled. + // But we leave it here just to minimize the changes in K1 and also to allow use the feature once somebody needs it. + // The reason for it's being disabled is described at KT-55357 + ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated(sinceVersion = null), // KT-36770 + // Disabled for indefinite time. See KT-53751 IgnoreNullabilityForErasedValueParameters(sinceVersion = null, kind = BUG_FIX),