Support delegating to interfaces in ultra-light classes

This commit is contained in:
Denis Zharkov
2018-12-04 11:15:56 +03:00
parent dbf9ff29a9
commit 52d5143dd7
4 changed files with 34 additions and 5 deletions
@@ -2,6 +2,11 @@
interface Base {
fun printMessage()
fun printMessageLine()
val x: Int
var y: Int
fun String.foo(y: Any?): Int
}
class BaseImpl(val x: Int) : Base {
@@ -9,7 +14,6 @@ class BaseImpl(val x: Int) : Base {
override fun printMessageLine() { println(x) }
}
/** should load cls */
class Derived(b: Base) : Base by b {
override fun printMessage() { print("abc") }
}