Files
kotlin-fork/js/js.translator/testData/box/delegation/delegationByNewInstance.kt
T
2018-09-12 09:49:25 +03:00

19 lines
377 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1292
package foo
interface Base {
abstract fun foo(x: String): String
}
class BaseImpl(val s: String) : Base {
override fun foo(x: String): String = "Base: ${s}:${x}"
}
class Derived() : Base by BaseImpl("test")
fun box(): String {
assertEquals("Base: test:!!", Derived().foo("!!"), "delegation by new instance")
return "OK"
}