From 0aa5170ba2bb799829f5ebcb892c762f3e1e3873 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 16 Nov 2023 21:26:02 +0100 Subject: [PATCH] K2: delay jspecify strict mode introduction to version 2.1 Related to KT-62352, KT-55586 --- 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 84f90ffadc2..0f9b54c5d8e 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 cannot be a value of a non-null type 'kotlin.String'. +compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. a.foo(null) ^ -COMPILATION_ERROR +compiler/testData/cli/jvm/jspecifyUsage.kt:3:5: warning: only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'kotlin.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 e3907701589..d5ffcc669a9 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