[FE] Allow declare sealed class inheritors in different files in one module

#KT-13495
This commit is contained in:
Dmitriy Novozhilov
2020-11-16 11:27:04 +03:00
committed by TeamCityServer
parent 1a377069dd
commit f5f1984a60
20 changed files with 222 additions and 13 deletions
@@ -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())
}