KT-44487 [Sealed Interfaces]: sealed-inheritors-provider for MPP
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
expect sealed class <!LINE_MARKER("descr='Is subclassed by CommonAImplTestClass CommonImplTestClass PlatformAXImplTestClass PlatformAYImplTestClass'")!>TestClass<!>()
|
||||
class CommonImplTestClass: TestClass()
|
||||
|
||||
|
||||
fun checkCommon(t: TestClass): Int = when (t) {
|
||||
is CommonImplTestClass -> 0
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class CommonAImplTestClass: <!SEALED_INHERITOR_IN_DIFFERENT_MODULE!>TestClass<!>()
|
||||
@@ -0,0 +1,8 @@
|
||||
MODULE common { platform=[JVM, JS, Native]; additionalCompilerArgs=: -XXLanguage:+SealedInterfaces -XXLanguage:+AllowSealedInheritorsInDifferentFilesOfSamePackage }
|
||||
MODULE commonA { platform=[JVM]; additionalCompilerArgs=: -XXLanguage:+SealedInterfaces -XXLanguage:+AllowSealedInheritorsInDifferentFilesOfSamePackage }
|
||||
MODULE platformAX { platform=[JVM]; additionalCompilerArgs=: -XXLanguage:+SealedInterfaces -XXLanguage:+AllowSealedInheritorsInDifferentFilesOfSamePackage }
|
||||
MODULE platformAY { platform=[JVM]; additionalCompilerArgs=: -XXLanguage:+SealedInterfaces -XXLanguage:+AllowSealedInheritorsInDifferentFilesOfSamePackage }
|
||||
|
||||
commonA -> common { kind=DEPENDS_ON }
|
||||
platformAX -> commonA { kind=DEPENDS_ON }
|
||||
platformAY -> commonA { kind=DEPENDS_ON }
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
actual sealed class <!LINE_MARKER("descr='Is subclassed by PlatformAXImplTestClass'")!>TestClass<!> actual constructor() {}
|
||||
class PlatformAXImplTestClass: TestClass()
|
||||
|
||||
fun checkCommonAX(t: TestClass): Int = when (t) {
|
||||
is CommonImplTestClass -> 0
|
||||
is CommonAImplTestClass -> 1
|
||||
is PlatformAXImplTestClass -> 2
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
actual sealed class <!LINE_MARKER("descr='Is subclassed by PlatformAYImplTestClass'")!>TestClass<!> actual constructor() {}
|
||||
class PlatformAYImplTestClass: TestClass()
|
||||
|
||||
fun checkCommonAY(t: TestClass): Int = when (t) {
|
||||
is CommonImplTestClass -> 0
|
||||
is CommonAImplTestClass -> 1
|
||||
is PlatformAYImplTestClass -> 2
|
||||
}
|
||||
Reference in New Issue
Block a user