Prohibit DelegationBy specifier when no primary constructor
Also add codegen test for case when there is primary
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user