Delegated implementations for functions and extension functions.

This commit is contained in:
Dmitry Petrov
2016-09-01 19:39:46 +03:00
committed by Dmitry Petrov
parent 2438876173
commit d27f22ae0e
7 changed files with 121 additions and 19 deletions
@@ -1,5 +1,14 @@
interface IBase
object BaseImpl : IBase
interface IBase {
fun foo(x: Int, s: String)
fun bar(): Int
fun String.qux()
}
object BaseImpl : IBase {
override fun foo(x: Int, s: String) {}
override fun bar(): Int = 42
override fun String.qux() {}
}
interface IOther
fun otherImpl(): IOther = object : IOther {}