Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Kotlin delegation via annotated interface properties #812

Merged
merged 1 commit into from
Aug 22, 2019

Conversation

ngsilverman
Copy link
Contributor

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

Copy link
Contributor

@elihart elihart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great :)

@ngsilverman ngsilverman merged commit 5d151cc into master Aug 22, 2019
@ngsilverman ngsilverman deleted the ns-delegation branch August 22, 2019 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants