Prefixing @EpoxyAttribute variable with "is" causes compile error
See original GitHub issueNot sure what’s going on here.
I’m creating my models in Kotlin and have an attribute as follows
@EpoxyAttribute var isChildComment: Boolean = false
This causes a compile error in the generated class
error: isChildComment() in VideoCommentModel_ cannot override isChildComment() in VideoCommentModel public boolean isChildComment() { ^ overridden method is final
If I change the attribute to the following, the compile error is resolved
@EpoxyAttribute var childComment: Boolean = false
or
@EpoxyAttribute var ischildComment: Boolean = false
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
detox build fails on mac, nvm not compatible with the "PREFIX ...
It used to set the $PREFIX env variable for no reason. Now it is fixed, see: https://github.com/npm/cli/issues/2398.
Read more >Multiple SCSS packages (Bootstrap & Fontawesome) compile ...
it's always an “Undefined variable” error. I can't get my head around it. Any ideas?
Read more >Java Examples for java.lang.annotation.Target - Javatips.net
This java examples will help you to understand the usage of java.lang.annotation.Target. These source code samples are taken from different open source ...
Read more >Fixing React Native build error nvm is not compatible with the ...
Fixing React Native build error nvm is not compatible with the “PREFIX” environment variable. While building base of the React Native app ...
Read more >Download Diff File - Gogs: Go Git Service
+ +Code generated by the Protocol Buffer compiler is owned by the owner +of the ... + work stoppage, computer failure or malfunction,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In your original version the equivalent bytecode is
kotlin makes the getter final
Epoxy’s generated model creates a getter for each attribute though, which calls the original model’s getter. In this case epoxy’s generated method has the same name for the getter, which is only the case for booleans.
the bytecode with jvm field is
so the field is accessed directly.
you can explore the generated kotlin bytecode and the generated epoxy model code to understand it better.
Whether it’s a bug or not, well, epoxy could be changed to not generate a getter if one already exists, but it’s not a high priority
If you add
@JvmField
to the field, that error should go away.For some reason, we have issues with boolean values and epoxy attribute as well.