[Test] Add test for KT-42995
This commit is contained in:
committed by
Space Team
parent
a35b3bfd17
commit
eb041d5d6d
+6
@@ -6612,6 +6612,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reassignmentInCatch.kt")
|
||||||
|
public void testReassignmentInCatch() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("reassignmentInTryCatch.kt")
|
@TestMetadata("reassignmentInTryCatch.kt")
|
||||||
public void testReassignmentInTryCatch() throws Exception {
|
public void testReassignmentInTryCatch() throws Exception {
|
||||||
|
|||||||
+6
@@ -6612,6 +6612,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reassignmentInCatch.kt")
|
||||||
|
public void testReassignmentInCatch() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("reassignmentInTryCatch.kt")
|
@TestMetadata("reassignmentInTryCatch.kt")
|
||||||
public void testReassignmentInTryCatch() throws Exception {
|
public void testReassignmentInTryCatch() throws Exception {
|
||||||
|
|||||||
+6
@@ -6612,6 +6612,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reassignmentInCatch.kt")
|
||||||
|
public void testReassignmentInCatch() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("reassignmentInTryCatch.kt")
|
@TestMetadata("reassignmentInTryCatch.kt")
|
||||||
public void testReassignmentInTryCatch() throws Exception {
|
public void testReassignmentInTryCatch() throws Exception {
|
||||||
|
|||||||
+6
@@ -6618,6 +6618,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reassignmentInCatch.kt")
|
||||||
|
public void testReassignmentInCatch() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("reassignmentInTryCatch.kt")
|
@TestMetadata("reassignmentInTryCatch.kt")
|
||||||
public void testReassignmentInTryCatch() throws Exception {
|
public void testReassignmentInTryCatch() throws Exception {
|
||||||
|
|||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// ISSUE: KT-42995
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val a: Int
|
||||||
|
try {
|
||||||
|
run {
|
||||||
|
a = 1
|
||||||
|
a.inc()
|
||||||
|
throw Exception("hmm")
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
<!VAL_REASSIGNMENT!>a<!> = 2
|
||||||
|
a.inc()
|
||||||
|
}
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// ISSUE: KT-42995
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val a: Int
|
||||||
|
try {
|
||||||
|
run {
|
||||||
|
a = 1
|
||||||
|
a.inc()
|
||||||
|
throw Exception("hmm")
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
a = 2
|
||||||
|
a.inc()
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -6618,6 +6618,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesOrderInPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reassignmentInCatch.kt")
|
||||||
|
public void testReassignmentInCatch() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("reassignmentInTryCatch.kt")
|
@TestMetadata("reassignmentInTryCatch.kt")
|
||||||
public void testReassignmentInTryCatch() throws Exception {
|
public void testReassignmentInTryCatch() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user