correct handling of delegate properties #KT-2786 fixed

This commit is contained in:
Alex Tkachman
2012-09-20 16:01:53 +03:00
parent 936f53fcbf
commit eaf9a79420
3 changed files with 20 additions and 0 deletions
@@ -0,0 +1,13 @@
trait FooTrait {
val propertyTest: String
}
class FooDelegate: FooTrait {
override val propertyTest: String = "OK"
}
class DelegateTest(): FooTrait by FooDelegate() {
fun test() = propertyTest
}
fun box() = DelegateTest().test()