Files
kotlin-fork/compiler/testData/codegen/box/classes/delegation4.kt
T
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

29 lines
495 B
Kotlin

open trait First {
public open fun foo() : Int
}
open trait Second : First {
public open fun bar() : Int
}
class Impl : Second {
public override fun foo() = 1
public override fun bar() = 2
}
class Test(s : Second) : Second by s {}
fun box() : String {
var t = Test(Impl())
if (t.foo() != 1)
return "Fail #1"
if (t.bar() != 2)
return "Fail #2"
if (t !is First)
return "Fail #3"
if (t !is Second)
return "Fail #4"
return "OK"
}