Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-compiler:2.7.0-alpha07
za...@gmail.com <za...@gmail.com> #4
Ahh, I didn't know room used `@JvmOverloads` constructors. Neat!
za...@gmail.com <za...@gmail.com> #5
Mentioned in the original issue, but dropping here too.
It seems you can't have nullable val properties. If I have a class with all val properties, it works fine. It complains about multiple constructors, but it doesn't fail at least
It seems you can't have nullable val properties. If I have a class with all val properties, it works fine. It complains about multiple constructors, but it doesn't fail at least
Description
Version used: 1.1.0-present
Theme used: NA
Devices/Android versions reproduced on: NA build-time
- Relevant code to trigger the issue: Any kotlin data class in an external module. Building the following project can reproduce it:
In Kotlin, data classes will have a primary constructor and sometimes generated synthetic constructors. ROOM's processor will complain about the presence of the synthetic ones (which are usually visible when reading the class file from an external library), but since it's reading metadata it could use it to find the "primary" constructor to know for sure.
Example:
The solution would be to find that constructor, then match it to the corresponding constructor as seen in the elements API