From 5a5d25d350a466e608d82dcf4d92ec3de122b948 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 1 Sep 2021 10:11:17 +0300 Subject: [PATCH] [FE 1.0] Postpone ProhibitSimplificationOfNonTrivialConstBooleanExpressions till 1.7 ^KT-39883 --- .../testData/ir/irText/expressions/simpleUnaryOperators.kt.txt | 2 +- .../testData/ir/irText/expressions/simpleUnaryOperators.txt | 3 +-- .../when-expression/p-4/neg/1.2.exceptions.compiletime.txt | 2 +- .../src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.kt.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.kt.txt index cc3c0593ddb..c2b7bca047d 100644 --- a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.kt.txt +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.kt.txt @@ -19,6 +19,6 @@ fun test5(x: Boolean): Boolean { } fun test6(): Boolean { - return true.not() + return false } diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt index c3113a636de..5c6a441119a 100644 --- a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt @@ -28,5 +28,4 @@ FILE fqName: fileName:/simpleUnaryOperators.kt FUN name:test6 visibility:public modality:FINAL <> () returnType:kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Boolean declared in ' - CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCL - $this: CONST Boolean type=kotlin.Boolean value=true + CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/when-expression/p-4/neg/1.2.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/expressions/when-expression/p-4/neg/1.2.exceptions.compiletime.txt index 455329cccc4..fb37ec742e5 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/when-expression/p-4/neg/1.2.exceptions.compiletime.txt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/when-expression/p-4/neg/1.2.exceptions.compiletime.txt @@ -1 +1 @@ -java.lang.IllegalStateException: NO_ELSE_IN_WHEN: 'when' expression must be exhaustive, add necessary 'true', 'false' branches or 'else' branch instead (15,17) in /1.2.kt +java.lang.IllegalStateException: NO_ELSE_IN_WHEN: 'when' expression must be exhaustive, add necessary 'false' branch or 'else' branch instead (15,17) in /1.2.kt diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 3f110faeeb5..9f751ff4cc8 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -210,7 +210,6 @@ enum class LanguageFeature( ProperTypeInferenceConstraintsProcessing(KOTLIN_1_6, kind = BUG_FIX), ClassTypeParameterAnnotations(KOTLIN_1_6), SafeCallsAreAlwaysNullable(KOTLIN_1_6), - ProhibitSimplificationOfNonTrivialConstBooleanExpressions(KOTLIN_1_6), TypeInferenceOnCallsWithSelfTypes(KOTLIN_1_6), WarnAboutNonExhaustiveWhenOnAlgebraicTypes(KOTLIN_1_6, kind = BUG_FIX), InstantiationOfAnnotationClasses(KOTLIN_1_6), @@ -230,6 +229,7 @@ enum class LanguageFeature( ProhibitInvalidCharsInNativeIdentifiers(KOTLIN_1_7, kind = BUG_FIX), DefinitelyNotNullTypeParameters(KOTLIN_1_7), DefinitelyNonNullableTypes(KOTLIN_1_7), + ProhibitSimplificationOfNonTrivialConstBooleanExpressions(KOTLIN_1_7), // Temporarily disabled, see KT-27084/KT-22379 SoundSmartcastFromLoopConditionForLoopAssignedVariables(sinceVersion = null, kind = BUG_FIX),