Delegation is only allowed if the target type is a trait

This commit is contained in:
Andrey Breslav
2011-09-27 10:25:24 +04:00
parent c6c87ec3c8
commit 0cb2765ab0
3 changed files with 23 additions and 0 deletions
@@ -0,0 +1,13 @@
open class Foo() {
}
class Barrr() : <!DELEGATION_NOT_TO_TRAIT!>Foo<!> by Foo() {}
trait T {}
class Br(t : T) : T by t {}
open enum class E() {}
class Test2(e : E) : <!DELEGATION_NOT_TO_TRAIT!>E<!> by e {}