FIR: introduce ThrowableSubclassChecker
This commit is contained in:
committed by
Mikhail Glukhikh
parent
cd189c0812
commit
a564f92eef
+5
@@ -419,6 +419,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/syntheticsVsNormalProperties.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableSubclass.kt")
|
||||
public void testThrowableSubclass() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/throwableSubclass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("treeSet.kt")
|
||||
public void testTreeSet() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/treeSet.kt");
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
FILE: throwableSubclass.kt
|
||||
public final class Test1<T, B> : R|kotlin/Exception| {
|
||||
public constructor<T, B>(): R|Test1<T, B>| {
|
||||
super<R|kotlin/Exception|>()
|
||||
}
|
||||
|
||||
public final inner class Test2<S, T, B> : R|kotlin/Throwable| {
|
||||
public constructor<S>(): R|Test1.Test2<S, T, B>| {
|
||||
super<R|kotlin/Throwable|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class Test3 : R|kotlin/NullPointerException| {
|
||||
public constructor(): R|Test1.Test3| {
|
||||
super<R|kotlin/NullPointerException|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final object Test4 : R|kotlin/Throwable| {
|
||||
private constructor(): R|Test1.Test4| {
|
||||
super<R|kotlin/Throwable|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final class Test5<T, B> : R|kotlin/Any| {
|
||||
public constructor<T, B>(): R|Test5<T, B>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final inner class Test6<T, B> : R|kotlin/Exception| {
|
||||
public constructor(): R|Test5.Test6<T, B>| {
|
||||
super<R|kotlin/Exception|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
local final class Test7 : R|kotlin/Throwable| {
|
||||
public constructor(): R|Test5.Test7| {
|
||||
super<R|kotlin/Throwable|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final fun <Z> topLevelFun(): R|kotlin/Unit| {
|
||||
local final class Test8 : R|kotlin/Error| {
|
||||
public constructor(): R|Test8| {
|
||||
super<R|kotlin/Error|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lval obj: R|<anonymous><Z>| = object : R|kotlin/Throwable| {
|
||||
private constructor(): R|<anonymous><Z>| {
|
||||
super<R|kotlin/Throwable|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
class Test1<<!GENERIC_THROWABLE_SUBCLASS!>T<!>, B> : Exception() {
|
||||
inner <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>class Test2<!><<!GENERIC_THROWABLE_SUBCLASS!>S<!>> : Throwable()
|
||||
class Test3 : NullPointerException()
|
||||
object Test4 : Throwable() {}
|
||||
}
|
||||
|
||||
class Test5<T, B> {
|
||||
inner <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>class Test6<!> : Exception()
|
||||
|
||||
fun foo() {
|
||||
<!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>class Test7<!> : Throwable()
|
||||
}
|
||||
}
|
||||
|
||||
fun <Z> topLevelFun() {
|
||||
<!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>class Test8<!> : Error()
|
||||
val obj = <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS{LT}!><!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS{PSI}!>object<!> : Throwable() {}<!>
|
||||
}
|
||||
+6
@@ -494,6 +494,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/syntheticsVsNormalProperties.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("throwableSubclass.kt")
|
||||
public void testThrowableSubclass() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/throwableSubclass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("treeSet.kt")
|
||||
public void testTreeSet() throws Exception {
|
||||
|
||||
+6
@@ -497,6 +497,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/syntheticsVsNormalProperties.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("throwableSubclass.kt")
|
||||
public void testThrowableSubclass() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/throwableSubclass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("treeSet.kt")
|
||||
public void testTreeSet() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user