From 34fb61fb3e410e764ad498025acc9225db21c38b Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Wed, 20 Oct 2021 11:58:20 +0300 Subject: [PATCH] Postpone promoting warnings to errors for `ProperTypeInferenceConstraintsProcessing` ^KT-49322 Fixed --- compiler/testData/diagnostics/tests/Bounds.kt | 2 +- .../projectionsScope/typeParameterBounds.kt | 4 ++-- .../diagnostics/tests/inference/kt47316.kt | 2 +- ...oundsViolationInDeepTypeAliasExpansion.fir.kt | 16 ---------------- .../boundsViolationInDeepTypeAliasExpansion.kt | 3 ++- .../boundsViolationInTypeAliasExpansion.kt | 2 +- .../kotlin/config/LanguageVersionSettings.kt | 2 +- 7 files changed, 8 insertions(+), 23 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.fir.kt diff --git a/compiler/testData/diagnostics/tests/Bounds.kt b/compiler/testData/diagnostics/tests/Bounds.kt index b6c3a1a2f22..2efca46f280 100644 --- a/compiler/testData/diagnostics/tests/Bounds.kt +++ b/compiler/testData/diagnostics/tests/Bounds.kt @@ -6,7 +6,7 @@ package boundsWithSubstitutors class C : A() val a = B() - val a1 = B<Int>() + val a1 = B<Int>() class X() diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt index 2fb01b55793..da3c5bfd356 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt @@ -20,7 +20,7 @@ fun foo2(a: A, b: A) { a.foo2(Inv()) a.foo2(Inv()) - a.foo2<Inv>(Inv()) + a.foo2<Inv>(Inv()) a.foo3(In()) a.foo3(In()) @@ -32,7 +32,7 @@ fun foo2(a: A, b: A) { b.foo2(Inv()) b.foo2(Inv()) - b.foo2<Inv>(Inv()) + b.foo2<Inv>(Inv()) b.foo3(In()) diff --git a/compiler/testData/diagnostics/tests/inference/kt47316.kt b/compiler/testData/diagnostics/tests/inference/kt47316.kt index f881ef0e15d..72c88dd57ab 100644 --- a/compiler/testData/diagnostics/tests/inference/kt47316.kt +++ b/compiler/testData/diagnostics/tests/inference/kt47316.kt @@ -30,7 +30,7 @@ fun String.asFsdAddress(): String { fun box(): String { val state = Test().state if (state is GoBuildingRunningState<*>) { - state.buildingWorkingDirectory.asFsdAddress() + state.buildingWorkingDirectory.asFsdAddress() } return "OK" } diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.fir.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.fir.kt deleted file mode 100644 index ad38c5b85db..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER - -class TColl> - -typealias TC = TColl -typealias TC2 = TC - -fun test1(x: TC2>) {} -fun test2(x: TC2>) {} -fun test3(x: TC2>) {} -fun test4(x: TC2>) {} - -val test5 = TC2>() -val test6 = TC2>() -val test7 = TC2>() -val test8 = TC2List>() diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt index 7ae8cec917e..c28152b7ac1 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER class TColl> @@ -13,4 +14,4 @@ fun test4(x: TC2>() val test6 = TC2>() val test7 = TC2>() -val test8 = TC2List>() +val test8 = TC2List>() diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt index 40739a7922b..badd11e9c6c 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt @@ -28,4 +28,4 @@ fun test12(x: TCList>) {} val test13 = TC>() val test14 = TC>() val test15 = TC>() -val test16 = TCList>() +val test16 = TCList>() diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 6e7e139f712..24e6f294fb8 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -203,7 +203,6 @@ enum class LanguageFeature( SuspendFunctionAsSupertype(KOTLIN_1_6), UnrestrictedBuilderInference(KOTLIN_1_6), - ProperTypeInferenceConstraintsProcessing(KOTLIN_1_6, kind = BUG_FIX), ClassTypeParameterAnnotations(KOTLIN_1_6), TypeInferenceOnCallsWithSelfTypes(KOTLIN_1_6), WarnAboutNonExhaustiveWhenOnAlgebraicTypes(KOTLIN_1_6, kind = BUG_FIX), @@ -235,6 +234,7 @@ enum class LanguageFeature( JvmPermittedSubclassesAttributeForSealed(KOTLIN_1_7), ForbidUsingExtensionPropertyTypeParameterInDelegate(KOTLIN_1_7, kind = BUG_FIX), IgnoreNullabilityForErasedValueParameters(KOTLIN_1_7, kind = BUG_FIX), + ProperTypeInferenceConstraintsProcessing(KOTLIN_1_7, kind = BUG_FIX), ProhibitNonExhaustiveIfInRhsOfElvis(KOTLIN_1_7, kind = BUG_FIX), // KT-44705 // 1.8