Implementing interface by delegation: creating delegates in class.
This commit is contained in:
committed by
Dmitry Petrov
parent
264c8afc78
commit
2438876173
@@ -0,0 +1,9 @@
|
||||
interface IBase
|
||||
object BaseImpl : IBase
|
||||
|
||||
interface IOther
|
||||
fun otherImpl(): IOther = object : IOther {}
|
||||
|
||||
class Test1 : IBase by BaseImpl
|
||||
|
||||
class Test2 : IBase by BaseImpl, IOther by otherImpl()
|
||||
Reference in New Issue
Block a user