[FE] Allow declare sealed class inheritors in different files in one module
#KT-13495
This commit is contained in:
committed by
TeamCityServer
parent
1a377069dd
commit
f5f1984a60
@@ -0,0 +1,24 @@
|
||||
// ISSUE: KT-13495
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// !LANGUAGE: +FreedomForSealedClasses
|
||||
|
||||
// FILE: a.kt
|
||||
|
||||
sealed class Base {
|
||||
class A : Base()
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
class B : Base()
|
||||
|
||||
// FILE: c.kt
|
||||
|
||||
fun getLetter(base: Base): String = when (base) {
|
||||
is Base.A -> "O"
|
||||
is B -> "K"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return getLetter(Base.A()) + getLetter(B())
|
||||
}
|
||||
Reference in New Issue
Block a user