[IC] Add tests for sealed classes (KT-45474)
This commit is contained in:
+13
-3
@@ -597,6 +597,11 @@ public class IncrementalFirICLightTreeJvmCompilerRunnerTestGenerated extends Abs
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -612,9 +617,14 @@ public class IncrementalFirICLightTreeJvmCompilerRunnerTestGenerated extends Abs
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
+13
-3
@@ -597,6 +597,11 @@ public class IncrementalFirJvmCompilerRunnerTestGenerated extends AbstractIncrem
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -612,9 +617,14 @@ public class IncrementalFirJvmCompilerRunnerTestGenerated extends AbstractIncrem
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
+13
-3
@@ -597,6 +597,11 @@ public class IncrementalFirLightTreeJvmCompilerRunnerTestGenerated extends Abstr
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -612,9 +617,14 @@ public class IncrementalFirLightTreeJvmCompilerRunnerTestGenerated extends Abstr
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
+13
-3
@@ -596,6 +596,11 @@ public class IncrementalJsCompilerRunnerTestGenerated extends AbstractIncrementa
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -611,9 +616,14 @@ public class IncrementalJsCompilerRunnerTestGenerated extends AbstractIncrementa
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
+13
-3
@@ -596,6 +596,11 @@ public class IncrementalJsCompilerRunnerWithMetadataOnlyTestGenerated extends Ab
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -611,9 +616,14 @@ public class IncrementalJsCompilerRunnerWithMetadataOnlyTestGenerated extends Ab
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
+13
-3
@@ -597,6 +597,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -612,9 +617,14 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
+13
-3
@@ -597,6 +597,11 @@ public class IncrementalJvmOldBackendCompilerRunnerTestGenerated extends Abstrac
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -612,9 +617,14 @@ public class IncrementalJvmOldBackendCompilerRunnerTestGenerated extends Abstrac
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
Generated
+13
-3
@@ -1266,6 +1266,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddImplements/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddIndirectInheritor")
|
||||
public void testSealedClassesAddIndirectInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddIndirectInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesAddInheritor")
|
||||
public void testSealedClassesAddInheritor() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesAddInheritor/");
|
||||
@@ -1281,9 +1286,14 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesRemoveInheritor/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesUseSwitch")
|
||||
public void testSealedClassesUseSwitch() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesUseSwitch/");
|
||||
@TestMetadata("sealedClassesWhenExpression")
|
||||
public void testSealedClassesWhenExpression() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWhenExpression/");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassesWithExpectActual")
|
||||
public void testSealedClassesWithExpectActual() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/sealedClassesWithExpectActual/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorInlined")
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
open class C : Any()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
open class C : Base
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
package test
|
||||
|
||||
class E {
|
||||
}
|
||||
class D : C()
|
||||
+2
-10
@@ -8,6 +8,7 @@ Marked as dirty by Kotlin:
|
||||
src/B.kt
|
||||
src/Base.kt
|
||||
src/C.kt
|
||||
src/D.kt
|
||||
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||
------------------------------------------
|
||||
Cleaning output files:
|
||||
@@ -16,22 +17,13 @@ Cleaning output files:
|
||||
out/production/module/test/B.class
|
||||
out/production/module/test/Base.class
|
||||
out/production/module/test/C.class
|
||||
out/production/module/test/D.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/A.kt
|
||||
src/B.kt
|
||||
src/Base.kt
|
||||
src/C.kt
|
||||
End of files
|
||||
Marked as dirty by Kotlin:
|
||||
src/D.kt
|
||||
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||
------------------------------------------
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/D.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/D.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package test
|
||||
|
||||
interface C : Base
|
||||
@@ -1,5 +0,0 @@
|
||||
package test
|
||||
|
||||
class D {
|
||||
lateinit var x: Base
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
interface A : Base
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
interface B : Base
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
sealed interface Base
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
sealed interface Base {
|
||||
|
||||
fun doSmth() = "doSmth"
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
//sealed interface Base
|
||||
|
||||
class Usage {
|
||||
|
||||
fun doSmth(x: Base) =
|
||||
when (x) {
|
||||
is A -> "A"
|
||||
is B -> "B"
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
-XXLanguage:+FreedomForSealedClasses -XXLanguage:+SealedInterfaces
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Compiling files:
|
||||
src/Base.kt
|
||||
End of files
|
||||
Marked as dirty by Kotlin:
|
||||
src/A.kt
|
||||
src/B.kt
|
||||
src/Base.kt
|
||||
src/Usage.kt
|
||||
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||
------------------------------------------
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/A.class
|
||||
out/production/module/test/B.class
|
||||
out/production/module/test/Base.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/A.kt
|
||||
src/B.kt
|
||||
src/Base.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
open class A: Base
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
actual class ExpectClass {
|
||||
actual fun doSmth() = ""
|
||||
}
|
||||
|
||||
expect class ExpectClass2 {
|
||||
fun doSmth(): String
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
actual class ExpectClass2 {
|
||||
actual fun doSmth() = ""
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class B : Base {
|
||||
|
||||
}
|
||||
|
||||
expect class ExpectClass {
|
||||
fun doSmth(): String
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
sealed interface Base
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
class C : A()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
class Unrelated {}
|
||||
+1
@@ -0,0 +1 @@
|
||||
-XXLanguage:+FreedomForSealedClasses -XXLanguage:+SealedInterfaces -Xmulti-platform
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Compiling files:
|
||||
src/C.kt
|
||||
End of files
|
||||
Marked as dirty by Kotlin:
|
||||
src/Actual.kt
|
||||
src/B.kt
|
||||
src/Base.kt
|
||||
src/C.kt
|
||||
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||
------------------------------------------
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/Actual.class
|
||||
out/production/module/test/B.class
|
||||
out/production/module/test/Base.class
|
||||
out/production/module/test/C.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/Actual.kt
|
||||
src/Actual2.kt
|
||||
src/Base.kt
|
||||
src/A.kt
|
||||
src/B.kt
|
||||
src/C.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
Reference in New Issue
Block a user