louiscad
11/03/2018, 1:17 AMlazy { … }
)Dico
11/03/2018, 1:34 AMval
with a getter that uses field-backed properties you declared later. That's allowed in Kotlin, thankfully.louiscad
11/03/2018, 2:09 AMlouiscad
11/03/2018, 2:10 AMgetValue
) as mentioned in the channelDico
11/03/2018, 1:11 PMDico
11/03/2018, 1:16 PMDico
11/03/2018, 1:21 PMlouiscad
11/03/2018, 1:27 PMDico
11/03/2018, 1:30 PMlouiscad
11/03/2018, 1:38 PMby
keyword is not the optimal keyword for interface implementation by delegation, or maybe it should not be the only keyword (you can think of a companion keyword) used for more advanced use cases.
Going further more advanced use cases support should have two things:
1. Declaring an interface is implemented by delegation, without providing the delegating property in the class declaration
2. Linking a property to be the delegated interface implementation (and your property can be a getter under the hood that is re-evaluated each time if you want)louiscad
11/03/2018, 1:41 PMDico
11/03/2018, 1:47 PMdelegate val
(or var)Dico
11/03/2018, 1:48 PMDico
11/03/2018, 1:48 PMDico
11/03/2018, 1:49 PMdelegate val a: Interface by b
Dico
11/03/2018, 1:49 PM