[FIR/AA decompiler] Add tests for sealed interfaces
^KT-62895
This commit is contained in:
committed by
Space Team
parent
7c8aff963f
commit
5797b4877c
+6
@@ -240,6 +240,12 @@ public class DecompiledKnmStubConsistencyFe10TestGenerated extends AbstractDecom
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/Sealed/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/SealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SecondaryConstructors")
|
||||
public void testSecondaryConstructors() throws Exception {
|
||||
|
||||
+6
@@ -240,6 +240,12 @@ public class DecompiledKnmStubConsistencyK2TestGenerated extends AbstractDecompi
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/Sealed/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/SealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SecondaryConstructors")
|
||||
public void testSecondaryConstructors() throws Exception {
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
package test
|
||||
|
||||
sealed interface SealedInterface {
|
||||
class Nested : SealedInterface
|
||||
object Top : SealedInterface
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
PsiJetFileStubImpl[package=test]
|
||||
PACKAGE_DIRECTIVE
|
||||
REFERENCE_EXPRESSION[referencedName=test]
|
||||
IMPORT_LIST
|
||||
CLASS[classId=test/SealedInterface, fqName=test.SealedInterface, isEnumEntry=false, isInterface=true, isLocal=false, isTopLevel=true, name=SealedInterface, superNames=[]]
|
||||
MODIFIER_LIST[public]
|
||||
CLASS_BODY
|
||||
CLASS[classId=test/SealedInterface.Nested, fqName=test.SealedInterface.Nested, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=Nested, superNames=[SealedInterface]]
|
||||
MODIFIER_LIST[public final]
|
||||
PRIMARY_CONSTRUCTOR[fqName=null, hasBody=false, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
MODIFIER_LIST[public]
|
||||
VALUE_PARAMETER_LIST
|
||||
SUPER_TYPE_LIST
|
||||
SUPER_TYPE_ENTRY
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=test]
|
||||
REFERENCE_EXPRESSION[referencedName=SealedInterface]
|
||||
CLASS_BODY
|
||||
OBJECT_DECLARATION[classId=test/SealedInterface.Top, fqName=test.SealedInterface.Top, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Top, superNames=[SealedInterface]]
|
||||
MODIFIER_LIST[public]
|
||||
SUPER_TYPE_LIST
|
||||
SUPER_TYPE_ENTRY
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=test]
|
||||
REFERENCE_EXPRESSION[referencedName=SealedInterface]
|
||||
CLASS_BODY
|
||||
+6
@@ -240,6 +240,12 @@ public class ClsStubBuilderK2CompilerTestGenerated extends AbstractClsStubBuilde
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/Sealed/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/SealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SecondaryConstructors")
|
||||
public void testSecondaryConstructors() throws Exception {
|
||||
|
||||
+6
@@ -240,6 +240,12 @@ public class ClsStubBuilderTestGenerated extends AbstractClsStubBuilderTest {
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/Sealed/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/SealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SecondaryConstructors")
|
||||
public void testSecondaryConstructors() throws Exception {
|
||||
|
||||
+6
@@ -240,6 +240,12 @@ public class ByDecompiledPsiStubBuilderK2CompilerTestGenerated extends AbstractB
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/Sealed/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/SealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SecondaryConstructors")
|
||||
public void testSecondaryConstructors() throws Exception {
|
||||
|
||||
+6
@@ -240,6 +240,12 @@ public class ByDecompiledPsiStubBuilderTestGenerated extends AbstractByDecompile
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/Sealed/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/SealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SecondaryConstructors")
|
||||
public void testSecondaryConstructors() throws Exception {
|
||||
|
||||
+6
@@ -776,6 +776,12 @@ public class FirLoadK1CompiledJvmKotlinTestGenerated extends AbstractFirLoadK1Co
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
|
||||
+6
@@ -776,6 +776,12 @@ public class FirLoadK2CompiledJvmKotlinTestGenerated extends AbstractFirLoadK2Co
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
public final class Inheritor2 : R|test/SealedInterface| {
|
||||
public constructor(): R|test/Inheritor2|
|
||||
|
||||
}
|
||||
|
||||
public final class Inheritor3 : R|test/SealedInterface| {
|
||||
public constructor(): R|test/Inheritor3|
|
||||
|
||||
}
|
||||
|
||||
public sealed interface SealedInterface : R|kotlin/Any| {
|
||||
public final class Inheritor1 : R|test/SealedInterface| {
|
||||
public constructor(): R|test/SealedInterface.Inheritor1|
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Inheritor3 : SealedInterface
|
||||
|
||||
sealed interface SealedInterface {
|
||||
class Inheritor1 : SealedInterface
|
||||
}
|
||||
|
||||
class Inheritor2 : SealedInterface
|
||||
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public final class Inheritor2 : test.SealedInterface {
|
||||
/*primary*/ public constructor Inheritor2()
|
||||
}
|
||||
|
||||
public final class Inheritor3 : test.SealedInterface {
|
||||
/*primary*/ public constructor Inheritor3()
|
||||
}
|
||||
|
||||
public sealed interface SealedInterface {
|
||||
|
||||
public final class Inheritor1 : test.SealedInterface {
|
||||
/*primary*/ public constructor Inheritor1()
|
||||
}
|
||||
}
|
||||
+5
@@ -2388,6 +2388,11 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SingleAbstractMethod.kt");
|
||||
|
||||
Generated
+5
@@ -695,6 +695,11 @@ public class LoadKotlinWithTypeTableTestGenerated extends AbstractLoadKotlinWith
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SingleAbstractMethod.kt");
|
||||
|
||||
+5
@@ -2389,6 +2389,11 @@ public class IrLoadJavaTestGenerated extends AbstractIrLoadJavaTest {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SingleAbstractMethod.kt");
|
||||
|
||||
Generated
+5
@@ -2388,6 +2388,11 @@ public class LoadJavaUsingJavacTestGenerated extends AbstractLoadJavaUsingJavacT
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SingleAbstractMethod.kt");
|
||||
|
||||
+5
@@ -697,6 +697,11 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SingleAbstractMethod.kt");
|
||||
|
||||
Generated
+6
@@ -722,6 +722,12 @@ public class FirLoadK2CompiledJsKotlinTestGenerated extends AbstractFirLoadK2Com
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/class/SealedInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SingleAbstractMethod.kt")
|
||||
public void testSingleAbstractMethod() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user