K1/K2: add a test fixing behavior of overloadResolutionByLambda/PCLA combo
This commit is contained in:
committed by
Space Team
parent
8217aa9633
commit
e532220305
+6
@@ -3838,6 +3838,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overloadResolutionByLambdaReturnType.kt")
|
||||
public void testOverloadResolutionByLambdaReturnType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/builderInference/overloadResolutionByLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/builderInference/issues")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -3838,6 +3838,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overloadResolutionByLambdaReturnType.kt")
|
||||
public void testOverloadResolutionByLambdaReturnType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/builderInference/overloadResolutionByLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/builderInference/issues")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -3832,6 +3832,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overloadResolutionByLambdaReturnType.kt")
|
||||
public void testOverloadResolutionByLambdaReturnType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/builderInference/overloadResolutionByLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/builderInference/issues")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -3838,6 +3838,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overloadResolutionByLambdaReturnType.kt")
|
||||
public void testOverloadResolutionByLambdaReturnType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/builderInference/overloadResolutionByLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/builderInference/issues")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+1
@@ -118,6 +118,7 @@ class FirOverloadByLambdaReturnTypeResolver(
|
||||
firstAtom,
|
||||
firstCandidate,
|
||||
forOverloadByLambdaReturnType = true,
|
||||
// we explicitly decided not to use PCLA in that case because this case didn't work before in K1
|
||||
withPCLASession = false,
|
||||
)
|
||||
while (iterator.hasNext()) {
|
||||
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
fun <E1> buildL(x: MutableList<E1>.() -> Int): Int = 1
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
fun <E2> buildL(x: MutableList<E2>.() -> String): String = ""
|
||||
|
||||
fun main() {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>buildL<!> {
|
||||
<!UNRESOLVED_REFERENCE!>add<!>("")
|
||||
""
|
||||
}
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
fun <E1> buildL(x: MutableList<E1>.() -> Int): Int = 1
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
fun <E2> buildL(x: MutableList<E2>.() -> String): String = ""
|
||||
|
||||
fun main() {
|
||||
<!NONE_APPLICABLE!>buildL<!> {
|
||||
<!UNRESOLVED_REFERENCE!>add<!>("")
|
||||
""
|
||||
}
|
||||
}
|
||||
Generated
+6
@@ -3838,6 +3838,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overloadResolutionByLambdaReturnType.kt")
|
||||
public void testOverloadResolutionByLambdaReturnType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/builderInference/overloadResolutionByLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/builderInference/issues")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Reference in New Issue
Block a user