Class objects also can have delegated members

This commit is contained in:
Alexander Udalov
2013-10-29 15:59:08 +04:00
parent 29f3c4a1a0
commit cdecbc0915
6 changed files with 45 additions and 4 deletions
@@ -0,0 +1,11 @@
package test
trait T {
fun foo(): Int
}
class A : T {
override fun foo() = 42
class object : T by A()
}
@@ -0,0 +1,15 @@
package test
internal final class A : test.T {
/*primary*/ public constructor A()
internal open override /*1*/ fun foo(): jet.Int
internal class object <class-object-for-A> : test.T {
/*primary*/ private constructor <class-object-for-A>()
internal open override /*1*/ /*delegation*/ fun foo(): jet.Int
}
}
internal trait T {
internal abstract fun foo(): jet.Int
}