From 0775748aa9bd564d769220fd6ca8c459d93a0815 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Tue, 6 Jun 2023 11:05:35 +0200 Subject: [PATCH] Postpone enabling JSpecify annotations by default until 2.0 Thus, KT-55586 is being postponed, too. The reasoning behind this change is that the language-committee issue has not been approved yet, so new annotation package can't be enabled by default, but it seems that it doesn't make sense having a different behavior for the old one but at least that would make them work consistently, so we postpone them, too. --- compiler/testData/cli/jvm/jspecifyDefault.out | 7 +++++-- .../kotlin/load/java/JavaNullabilityAnnotationSettings.kt | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/testData/cli/jvm/jspecifyDefault.out b/compiler/testData/cli/jvm/jspecifyDefault.out index 2a911ebf791..7c2a6d77f6e 100644 --- a/compiler/testData/cli/jvm/jspecifyDefault.out +++ b/compiler/testData/cli/jvm/jspecifyDefault.out @@ -1,4 +1,7 @@ -compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null can not be a value of a non-null type String +compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: type mismatch: inferred type is Nothing? but String was expected a.foo(null) ^ -COMPILATION_ERROR +compiler/testData/cli/jvm/jspecifyUsage.kt:3:5: warning: unsafe use of a nullable receiver of type String? + a.bar().hashCode() + ^ +OK diff --git a/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt b/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt index 832064f6476..e3907701589 100644 --- a/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt +++ b/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt @@ -45,12 +45,12 @@ val NULLABILITY_ANNOTATION_SETTINGS: NullabilityAnnotationStates