package foo var global: String field = "" get set class Base2Impl : Base2 { val s: String field = s get constructor(s: String) /* primary */ { super/*Any*/() /* () */ } override fun bar(x: String): String { return "Base2: " + .() + ":" + x } } class BaseImpl : Base { val s: String field = s get constructor(s: String) /* primary */ { super/*Any*/() /* () */ } override fun foo(x: String): String { return "Base: " + .() + ":" + x } } class Derived : DerivedBase, Base, Base2 { private /* final field */ val $$delegate_0: Base = newBase() private /* final field */ val $$delegate_1: Base2 = newBase2() init { { // BLOCK ( = ().plus(other = ":Derived")) } } constructor() /* primary */ { super/*DerivedBase*/() /* () */ } override fun bar(x: String): String { return .#$$delegate_1.bar(x = x) } override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } } class Derived1 : DerivedBase, Base, Base2 { private /* final field */ val $$delegate_0: Base = newBase() private /* final field */ val $$delegate_1: Base2 = newBase2() init { { // BLOCK ( = ().plus(other = ":Derived")) } } constructor() /* primary */ { super/*DerivedBase*/() /* () */ } override fun bar(x: String): String { return .#$$delegate_1.bar(x = x) } override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } } class Derived2 : DerivedBase, Base, Base2 { private /* final field */ val $$delegate_0: Base = newBase() private /* final field */ val $$delegate_1: Base2 = newBase2() init { { // BLOCK ( = ().plus(other = ":Derived")) } } constructor() /* primary */ { super/*DerivedBase*/() /* () */ } override fun bar(x: String): String { return .#$$delegate_1.bar(x = x) } override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } } open class DerivedBase { init { { // BLOCK ( = ().plus(other = ":DerivedBase")) } } constructor() /* primary */ { super/*Any*/() /* () */ } } interface Base { abstract fun foo(x: String): String } interface Base2 { abstract fun bar(x: String): String } fun box(): String { var d: Derived = Derived() var d1: Derived1 = Derived1() var d2: Derived2 = Derived2() return "OK" } fun newBase(): Base { { // BLOCK ( = ().plus(other = ":newBase")) } return BaseImpl(s = "test") } fun newBase2(): Base2 { { // BLOCK ( = ().plus(other = ":newBase2")) } return Base2Impl(s = "test") }