Refactor ImplementationBodyCodegen.getTraitImplementations()
Make it static, extract a method which finds an implementation in a trait for a fake override
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
open class Base
|
||||
|
||||
trait Trait : Base {
|
||||
private val value : String
|
||||
get() = "OK"
|
||||
|
||||
override fun toString() = object {
|
||||
fun foo() = value
|
||||
}.foo()
|
||||
}
|
||||
|
||||
class Derived : Trait, Base()
|
||||
|
||||
fun box() = "${Derived()}"
|
||||
Reference in New Issue
Block a user