mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 00:21:26 +00:00
Sometimes instead of {POP, GETSTATIC Unit.INSTANCE, ARETURN} sequence
the codegen emits {CHECKCAST Unit, ARETURN} sequence, which breaks tail
call optimization. By replacing CHECKCAST with ARETURN we eliminate
this issue.
#KT-19790: Fixed
13 lines
210 B
Kotlin
Vendored
13 lines
210 B
Kotlin
Vendored
sealed class X {
|
|
class A : X()
|
|
class B : X()
|
|
}
|
|
|
|
suspend fun process(a: X.A) {}
|
|
suspend fun process(b: X.B) {}
|
|
|
|
suspend fun process(x: X) = when (x) {
|
|
is X.A -> process(x)
|
|
is X.B -> process(x)
|
|
}
|