Postpone promoting warnings to errors for ProperTypeInferenceConstraintsProcessing

^KT-49322 Fixed
This commit is contained in:
Victor Petukhov
2021-10-20 11:58:20 +03:00
parent 64c682f465
commit 34fb61fb3e
7 changed files with 8 additions and 23 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ package boundsWithSubstitutors
class C : A<C>()
val a = B<C>()
val a1 = B<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>Int<!>>()
val a1 = B<<!UPPER_BOUND_VIOLATED!>Int<!>>()
class X<A, B : A>()
@@ -20,7 +20,7 @@ fun foo2(a: A<out CharSequence>, b: A<in CharSequence>) {
a.foo2(Inv())
a.foo2(<!TYPE_MISMATCH!>Inv<CharSequence>()<!>)
a.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>Inv()<!>)
a.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH!>Inv()<!>)
a.foo3(In())
a.foo3(In<CharSequence>())
@@ -32,7 +32,7 @@ fun foo2(a: A<out CharSequence>, b: A<in CharSequence>) {
b.foo2(Inv())
b.foo2(<!TYPE_MISMATCH!>Inv<CharSequence>()<!>)
b.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>Inv()<!>)
b.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH!>Inv()<!>)
b.foo3(<!TYPE_MISMATCH!>In<CharSequence>()<!>)
+1 -1
View File
@@ -30,7 +30,7 @@ fun String.asFsdAddress(): String {
fun box(): String {
val state = Test().state
if (state is GoBuildingRunningState<*>) {
state.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>buildingWorkingDirectory<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>asFsdAddress<!>()
<!DEBUG_INFO_SMARTCAST, TYPE_MISMATCH_WARNING!>state<!>.buildingWorkingDirectory.asFsdAddress()
}
return "OK"
}
@@ -1,16 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
class TColl<T, C : Collection<T>>
typealias TC<T1, T2> = TColl<T1, T2>
typealias TC2<T1, T2> = TC<T1, T2>
fun test1(x: TC2<Number, Collection<Number>>) {}
fun test2(x: TC2<Number, Collection<Int>>) {}
fun test3(x: TC2<Number, List<Int>>) {}
fun test4(x: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>TC2<Number, List<Any>><!>) {}
val test5 = TC2<Number, Collection<Number>>()
val test6 = TC2<Number, Collection<Int>>()
val test7 = TC2<Number, List<Int>>()
val test8 = TC2<Number, <!UPPER_BOUND_VIOLATED!>List<Any><!>>()
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
class TColl<T, C : Collection<T>>
@@ -13,4 +14,4 @@ fun test4(x: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>TC2<Number, List<Any
val test5 = TC2<Number, Collection<Number>>()
val test6 = TC2<Number, Collection<Int>>()
val test7 = TC2<Number, List<Int>>()
val test8 = TC2<Number, <!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>List<Any><!>>()
val test8 = TC2<Number, <!UPPER_BOUND_VIOLATED!>List<Any><!>>()
@@ -28,4 +28,4 @@ fun test12(x: TC<Number, <!UPPER_BOUND_VIOLATED!>List<Any><!>>) {}
val test13 = TC<Number, Collection<Number>>()
val test14 = TC<Number, Collection<Int>>()
val test15 = TC<Number, List<Int>>()
val test16 = TC<Number, <!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>List<Any><!>>()
val test16 = TC<Number, <!UPPER_BOUND_VIOLATED!>List<Any><!>>()
@@ -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