Add support for Kotlin delegation via annotated interface properties #812
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usually when implementing an interface its properties have to be overridden and can be annotated as Epoxy properties in the implementing class.
With Kotlin delegation however, classes can delegate the implementation of an interface to another object, which can reduce boilerplate substantially and avoids redundant code.
Currently, if properties of a delegated interface are meant to be used with Epoxy, they would have to be overridden, despite the delegation, so that they can be annotated, thus losing the benefits of delegation. With this change, the interface properties can be annotated as Epoxy properties, and will carry over to the delegating class.
The test illustrates this use case well.
@elihart