[Test] Add regression test for KT-66336

This commit is contained in:
Dmitriy Novozhilov
2024-03-14 11:34:02 +02:00
committed by Space Team
parent fcc4470b74
commit c62fe0d107
6 changed files with 50 additions and 0 deletions
@@ -18969,6 +18969,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/forks"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("forkInWhen.kt")
public void testForkInWhen() {
runTest("compiler/testData/diagnostics/tests/inference/forks/forkInWhen.kt");
}
@Test
@TestMetadata("nestedCallVariableFixation.kt")
public void testNestedCallVariableFixation() {
@@ -18969,6 +18969,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/forks"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("forkInWhen.kt")
public void testForkInWhen() {
runTest("compiler/testData/diagnostics/tests/inference/forks/forkInWhen.kt");
}
@Test
@TestMetadata("nestedCallVariableFixation.kt")
public void testNestedCallVariableFixation() {
@@ -18963,6 +18963,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/forks"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
}
@Test
@TestMetadata("forkInWhen.kt")
public void testForkInWhen() {
runTest("compiler/testData/diagnostics/tests/inference/forks/forkInWhen.kt");
}
@Test
@TestMetadata("nestedCallVariableFixation.kt")
public void testNestedCallVariableFixation() {
@@ -18969,6 +18969,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/forks"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
}
@Test
@TestMetadata("forkInWhen.kt")
public void testForkInWhen() {
runTest("compiler/testData/diagnostics/tests/inference/forks/forkInWhen.kt");
}
@Test
@TestMetadata("nestedCallVariableFixation.kt")
public void testNestedCallVariableFixation() {
@@ -0,0 +1,20 @@
// FIR_IDENTICAL
// ISSUE: KT-66336
interface A : Comparable<A>
interface B : Comparable<B>
open class Base<T>
class Derived<T : Comparable<T>, in S : T?>(expr: Base<in S>) : Base<T?>()
fun call(f: (String) -> Base<*>? = { null }) {}
fun test(b: Base<B>) {
call {
when (it) {
"a" -> b
"b" -> Derived(Base<A>())
else -> null
}
}
}
@@ -18969,6 +18969,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/forks"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("forkInWhen.kt")
public void testForkInWhen() {
runTest("compiler/testData/diagnostics/tests/inference/forks/forkInWhen.kt");
}
@Test
@TestMetadata("nestedCallVariableFixation.kt")
public void testNestedCallVariableFixation() {