[FIR] Fix NPE on empty throws
^KT-60325 fixed
This commit is contained in:
+6
@@ -321,6 +321,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/emptyLhsClassLiterals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EmptyThrow.kt")
|
||||
public void testEmptyThrow() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/EmptyThrow.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryAsType.kt")
|
||||
public void testEnumEntryAsType() throws Exception {
|
||||
|
||||
+6
@@ -321,6 +321,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/emptyLhsClassLiterals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EmptyThrow.kt")
|
||||
public void testEmptyThrow() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/EmptyThrow.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryAsType.kt")
|
||||
public void testEnumEntryAsType() throws Exception {
|
||||
|
||||
+6
@@ -321,6 +321,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/emptyLhsClassLiterals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EmptyThrow.kt")
|
||||
public void testEmptyThrow() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/EmptyThrow.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryAsType.kt")
|
||||
public void testEnumEntryAsType() throws Exception {
|
||||
|
||||
+6
@@ -321,6 +321,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/emptyLhsClassLiterals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EmptyThrow.kt")
|
||||
public void testEmptyThrow() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/EmptyThrow.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryAsType.kt")
|
||||
public void testEnumEntryAsType() throws Exception {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ object FirThrowExpressionTypeChecker : FirThrowExpressionChecker() {
|
||||
|
||||
if (!actualType.isSubtypeOf(expectedType, context.session)) {
|
||||
reporter.reportOn(
|
||||
expression.exception.source,
|
||||
expression.exception.source ?: expression.source,
|
||||
FirErrors.TYPE_MISMATCH,
|
||||
expectedType,
|
||||
actualType,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
fun someFun(i:Int) {
|
||||
val x = i ?: throw<!SYNTAX!><!>
|
||||
}
|
||||
Generated
+6
@@ -321,6 +321,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/emptyLhsClassLiterals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EmptyThrow.kt")
|
||||
public void testEmptyThrow() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/EmptyThrow.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryAsType.kt")
|
||||
public void testEnumEntryAsType() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user