Files
kotlin-fork/compiler/testData/codegen/box/regressions/kt10143.kt
T
2018-06-28 12:26:41 +02:00

35 lines
610 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// FILE: Outer.kt
package another
open class Outer {
protected class Stage(val run: () -> Unit)
protected class My(var stage: Stage? = null) {
fun initStage(f: () -> Unit): Stage {
stage = Stage(f)
return stage!!
}
}
protected fun my(init: My.() -> Unit): My {
val result = My()
result.init()
return result
}
}
// FILE: Main.kt
package other
class Derived : another.Outer() {
init {
my {
initStage { }
}
}
}
fun box(): String {
Derived()
return "OK"
}