Files
kotlin-fork/idea/testData/codegen/classes/funDelegation.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

17 lines
374 B
Plaintext

open class Base() {
fun n(n : Int) : Int = n + 1
}
trait class Abstract {}
class Derived1() : Base(), Abstract {}
class Derived2() : Abstract, Base() {}
fun test(s : Base) : Boolean = s.n(238) == 239
fun box() : String {
if (!test(Base())) return "Fail #1"
if (!test(Derived1())) return "Fail #2"
if (!test(Derived2())) return "Fail #3"
return "OK"
}