KT-3538: Super call to trait implemetation invokes method from base class

This commit is contained in:
Mikhael Bogdanov
2013-04-24 13:18:40 +04:00
parent aa2db75266
commit b6fc0c5c13
3 changed files with 39 additions and 4 deletions
@@ -0,0 +1,21 @@
open class Base {
open fun sayHello(): String {
return "O"
}
}
trait Trait: Base {
override fun sayHello(): String {
return "K"
}
}
class Derived(): Base(), Trait {
override fun sayHello(): String {
return super<Base>.sayHello() + super<Trait>.sayHello()
}
}
fun box(): String {
return Derived().sayHello()
}