fc838dbb53
Make it static, extract a method which finds an implementation in a trait for a fake override
16 lines
249 B
Kotlin
16 lines
249 B
Kotlin
open class Base
|
|
|
|
trait Derived : Base {
|
|
fun foo(): String {
|
|
return object {
|
|
fun bar() = baz(this@Derived)
|
|
}.bar()
|
|
}
|
|
}
|
|
|
|
class DerivedImpl : Derived, Base()
|
|
|
|
fun baz(b: Base) = "OK"
|
|
|
|
fun box() = DerivedImpl().foo()
|