Delegated implementations for functions and extension functions.
This commit is contained in:
committed by
Dmitry Petrov
parent
2438876173
commit
d27f22ae0e
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user