-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Auto generated MemberInjectors does not compile with Kotlin #92
Comments
So Dagger has no guarantee of being usable by other languages than Java, even if those languages have java-compatible layers, so this issue is out of scope. In particular, I don't know the subtleties that Kotlin has around field assignment at the byte-code level. That said, based on your bug listed above, you said it seems to fail on fiend injection - I would use setter/method injection as a workaround. MembersInjector will assign using a setter if the setter is annotated with @Inject as opposed to the field. |
I thought that it's not in the scope that's why I reported issue for Kotlin at the first place. I simply hoped that you can find a workaround for me and you did! Thank you. It works! If I would be more experienced in Dagger I would probably figure it out myself 😄 but I am not. So thanks again! |
:) No worries. I commented that way for completeness/clarity. On Wed Dec 10 2014 at 11:18:37 AM Damian Petla notifications@github.com
|
@cgruber Is there any magic, that Dagger processor has access to annotations in Kotlin code? Other annotation processing libraries don't have the same success. |
I have reported issue on jetbrains bug tracker https://youtrack.jetbrains.com/issue/KT-6446
Basically, MemberInjector rely on property assignment. Even if Kotlin's property is public only setter is available from the java class.
Maybe you can provide some workarounds for this?
The text was updated successfully, but these errors were encountered: