KT-3538: Super call to trait implemetation invokes method from base class
This commit is contained in:
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user