Files
kotlin-fork/compiler/testData/codegen/box/secondaryConstructors/delegationWithPrimary.kt
T
Denis Zharkov 70c573864a Prohibit DelegationBy specifier when no primary constructor
Also add codegen test for case when there is primary
2015-03-11 17:45:29 +03:00

18 lines
208 B
Kotlin

trait A {
fun foo(): String
}
class B : A {
override fun foo() = "OK"
}
val global = B()
class C(x: Int) : A by global {
constructor(): this(1) {}
}
fun box(): String {
return C().foo()
}