[FIR] Reproduce KT-64644

Ensure the given code crashes the
compiler.

^KT-64644
This commit is contained in:
Nikolay Lunyak
2024-01-03 13:55:41 +02:00
committed by Space Team
parent aaf34c3436
commit 7c3042772e
7 changed files with 52 additions and 0 deletions
@@ -213,6 +213,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/comparisonOfGenericInterfaceWithGenericClass.kt");
}
@Test
@TestMetadata("compilerCrashInTypeParameterBoundsChecker.kt")
public void testCompilerCrashInTypeParameterBoundsChecker() throws Exception {
runTest("compiler/testData/diagnostics/tests/compilerCrashInTypeParameterBoundsChecker.kt");
}
@Test
@TestMetadata("compilerCrashParameterType.kt")
public void testCompilerCrashParameterType() throws Exception {
@@ -213,6 +213,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/comparisonOfGenericInterfaceWithGenericClass.kt");
}
@Test
@TestMetadata("compilerCrashInTypeParameterBoundsChecker.kt")
public void testCompilerCrashInTypeParameterBoundsChecker() throws Exception {
runTest("compiler/testData/diagnostics/tests/compilerCrashInTypeParameterBoundsChecker.kt");
}
@Test
@TestMetadata("compilerCrashParameterType.kt")
public void testCompilerCrashParameterType() throws Exception {
@@ -213,6 +213,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/comparisonOfGenericInterfaceWithGenericClass.kt");
}
@Test
@TestMetadata("compilerCrashInTypeParameterBoundsChecker.kt")
public void testCompilerCrashInTypeParameterBoundsChecker() throws Exception {
runTest("compiler/testData/diagnostics/tests/compilerCrashInTypeParameterBoundsChecker.kt");
}
@Test
@TestMetadata("compilerCrashParameterType.kt")
public void testCompilerCrashParameterType() throws Exception {
@@ -213,6 +213,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/comparisonOfGenericInterfaceWithGenericClass.kt");
}
@Test
@TestMetadata("compilerCrashInTypeParameterBoundsChecker.kt")
public void testCompilerCrashInTypeParameterBoundsChecker() throws Exception {
runTest("compiler/testData/diagnostics/tests/compilerCrashInTypeParameterBoundsChecker.kt");
}
@Test
@TestMetadata("compilerCrashParameterType.kt")
public void testCompilerCrashParameterType() throws Exception {
@@ -0,0 +1,11 @@
// ISSUE: KT-64644
// WITH_STDLIB
typealias MaybePair = Pair<Int, Int>?
fun <T: <!FINAL_UPPER_BOUND!>MaybePair<!>> foo(x: T) {
if (x != null) {
println(x<!UNSAFE_CALL!>.<!>first)
println(x<!UNSAFE_CALL!>.<!>second)
}
}
@@ -0,0 +1,11 @@
// ISSUE: KT-64644
// WITH_STDLIB
typealias MaybePair = Pair<Int, Int>?
fun <T: MaybePair> foo(x: T) {
if (x != null) {
println(<!DEBUG_INFO_SMARTCAST!>x<!>.first)
println(<!DEBUG_INFO_SMARTCAST!>x<!>.second)
}
}
@@ -213,6 +213,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/comparisonOfGenericInterfaceWithGenericClass.kt");
}
@Test
@TestMetadata("compilerCrashInTypeParameterBoundsChecker.kt")
public void testCompilerCrashInTypeParameterBoundsChecker() throws Exception {
runTest("compiler/testData/diagnostics/tests/compilerCrashInTypeParameterBoundsChecker.kt");
}
@Test
@TestMetadata("compilerCrashParameterType.kt")
public void testCompilerCrashParameterType() throws Exception {