[Test] Add test for KT-40851
This commit is contained in:
committed by
Space Team
parent
eb041d5d6d
commit
31d046e8cd
+6
@@ -6867,6 +6867,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/expressionInUnitLiteral.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initializationInUnreachableCode.kt")
|
||||
public void testInitializationInUnreachableCode() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/initializationInUnreachableCode.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt2585_1.kt")
|
||||
public void testKt2585_1() throws Exception {
|
||||
|
||||
+6
@@ -6867,6 +6867,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/expressionInUnitLiteral.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initializationInUnreachableCode.kt")
|
||||
public void testInitializationInUnreachableCode() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/initializationInUnreachableCode.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt2585_1.kt")
|
||||
public void testKt2585_1() throws Exception {
|
||||
|
||||
+6
@@ -6867,6 +6867,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/expressionInUnitLiteral.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initializationInUnreachableCode.kt")
|
||||
public void testInitializationInUnreachableCode() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/initializationInUnreachableCode.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt2585_1.kt")
|
||||
public void testKt2585_1() throws Exception {
|
||||
|
||||
+6
@@ -6873,6 +6873,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/expressionInUnitLiteral.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initializationInUnreachableCode.kt")
|
||||
public void testInitializationInUnreachableCode() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/initializationInUnreachableCode.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt2585_1.kt")
|
||||
public void testKt2585_1() throws Exception {
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// COMPARE_WITH_LIGHT_TREE
|
||||
// ISSUE: KT-40851
|
||||
|
||||
fun error(): Nothing = throw Exception()
|
||||
|
||||
<!UNREACHABLE_CODE{LT}!>class Some<!UNREACHABLE_CODE{PSI}!>()<!> {
|
||||
var x: Int
|
||||
val y: Int =<!> error()
|
||||
|
||||
<!UNREACHABLE_CODE{LT}!>init {
|
||||
<!UNREACHABLE_CODE!>x = 1<!>;
|
||||
}
|
||||
}<!>
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// COMPARE_WITH_LIGHT_TREE
|
||||
// ISSUE: KT-40851
|
||||
|
||||
fun error(): Nothing = throw Exception()
|
||||
|
||||
class Some() {
|
||||
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>var x: Int<!>
|
||||
val y: Int = error()
|
||||
|
||||
init {
|
||||
x = 1;
|
||||
}
|
||||
}
|
||||
Generated
+6
@@ -6873,6 +6873,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/expressionInUnitLiteral.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initializationInUnreachableCode.kt")
|
||||
public void testInitializationInUnreachableCode() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/initializationInUnreachableCode.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt2585_1.kt")
|
||||
public void testKt2585_1() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user