FIR: introduce CatchParameterChecker

This commit is contained in:
eugenpolytechnic
2021-01-29 23:57:19 +03:00
committed by Mikhail Glukhikh
parent d8549d6292
commit 5c0231b727
16 changed files with 123 additions and 10 deletions
@@ -54,6 +54,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/cast.kt");
}
@TestMetadata("catchParameter.kt")
public void testCatchParameter() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/catchParameter.kt");
}
@TestMetadata("companion.kt")
public void testCompanion() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt");
@@ -0,0 +1,20 @@
FILE: catchParameter.kt
public final fun <T> test(): R|kotlin/Unit| {
try {
}
catch (e: R|kotlin/NullPointerException| = R|java/lang/NullPointerException.NullPointerException|()) {
}
try {
}
catch (e: R|T|) {
}
}
public final inline fun <reified T> anotherTest(): R|kotlin/Unit| {
try {
}
catch (e: R|T|) {
}
}
@@ -0,0 +1,13 @@
fun <T> test() {
try {
} catch (<!CATCH_PARAMETER_WITH_DEFAULT_VALUE!>e: NullPointerException = NullPointerException()<!>) {
}
try {} catch (<!TYPE_PARAMETER_IN_CATCH_CLAUSE!>e: T<!>) {}
}
inline fun <reified T> anotherTest() {
try {} catch (<!REIFIED_TYPE_IN_CATCH_CLAUSE!>e: T<!>) {}
}
@@ -56,6 +56,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
runTest("compiler/fir/analysis-tests/testData/resolve/cast.kt");
}
@Test
@TestMetadata("catchParameter.kt")
public void testCatchParameter() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/catchParameter.kt");
}
@Test
@TestMetadata("companion.kt")
public void testCompanion() throws Exception {
@@ -59,6 +59,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolve/cast.kt");
}
@Test
@TestMetadata("catchParameter.kt")
public void testCatchParameter() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/catchParameter.kt");
}
@Test
@TestMetadata("companion.kt")
public void testCompanion() throws Exception {