Files
kotlin/compiler/testData/codegen/box/classes/delegation4.kt
Mikhail Glukhikh 4bd48c4796 Regular modifier checker implemented (initial version). A set of tests fixed accordingly.
Most of modifier diagnostic is expressed by REDUNDANT_MODIFIER, INCOMPATIBLE_MODIFIERS, REPEATED_MODIFIER, WRONG_MODIFIER_TARGET, WRONG_MODIFIER_PARENT.
A set of modifier diagnostics is not in use now (but not deleted yet).
2015-08-03 19:41:50 +03:00

29 lines
493 B
Kotlin
Vendored

interface First {
public open fun foo() : Int
}
interface 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"
}