Files
kotlin-fork/idea/testData/codegen/classes/rightHandOverride.jet
T
Andrey Breslav 71bc41a938 KT-286 Check supertype lists (in progress)
Tests involving multiple inheritance fixed
2011-09-08 16:20:01 +04:00

20 lines
361 B
Plaintext

// Changed when traits were introduced. May not make sense any more
trait class Left {}
open class Right() {
virtual fun f() = 42
}
class D() : Left, Right() {
override fun f() = 239
}
fun box() : String {
val r : Right = Right()
val d : D = D()
if (r.f() != 42) return "Fail #1"
if (d.f() != 239) return "Fail #2"
return "OK"
}