[FE 1.0] Don't use BuilderInferenceSubstitutionConstraintPosition for declared upper bound constraint with no substituted upper bound

It leads to further infer type variable into those upper bounds which is forbidden

Substituted upper bounds is ok because specific substituted types came from constraints of other proper positions, or if specific substituted type is from declared upper bound too, then there should be another declared upper bound with no substitution

^KT-51464 Fixed
^KT-47986 Fixed
This commit is contained in:
Victor Petukhov
2022-05-31 09:57:00 +02:00
committed by teamcity
parent c3b5d83f31
commit 848075192c
16 changed files with 278 additions and 1 deletions
@@ -14219,6 +14219,30 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt47744.kt");
}
@Test
@TestMetadata("kt47986.kt")
public void testKt47986() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt47986.kt");
}
@Test
@TestMetadata("kt47986_2.kt")
public void testKt47986_2() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt47986_2.kt");
}
@Test
@TestMetadata("kt47986_3.kt")
public void testKt47986_3() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt47986_3.kt");
}
@Test
@TestMetadata("kt47986_4.kt")
public void testKt47986_4() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt47986_4.kt");
}
@Test
@TestMetadata("kt49285.kt")
public void testKt49285() throws Exception {
@@ -14255,6 +14279,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt51148.kt");
}
@Test
@TestMetadata("kt51464.kt")
public void testKt51464() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt51464.kt");
}
@Test
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {