Fixed
Status Update
Comments
za...@gmail.com <za...@gmail.com> #2
I should probably elaborate on that a bit more here :P. The ideal case would be that data classes written in other modules work the same when consumed. A standard data class (no secondary constructors, `val` properties) works fine when in the same module. The errors produced are also pretty confusing. They'll usually give what they read from the bytecode (constructor params called "var0" or the like) and reports missing setters for fields without names of said fields.
mr...@googlemail.com <mr...@googlemail.com> #3
I can confirm the bug and the workaround. The same problem arises when you use a data-class from a library with @Embedded
yb...@google.com <yb...@google.com> #5
given that log, looks like kotlin again not generating proper parameter names for methods.
yb...@google.com <yb...@google.com> #6
so turns out this is not about kotlin.
does not work w/ javac either because parameter names are not part of the class signature unless compiled w/ debug.
We will need to add a new annotation to support this.
does not work w/ javac either because parameter names are not part of the class signature unless compiled w/ debug.
We will need to add a new annotation to support this.
za...@gmail.com <za...@gmail.com> #7
True on the javac bit, but for kotlin you should be able to read the parameter names from the `@Metadata` annotations (since the param names are part of the public API in kotlin). There's no public API around this today though admittedly :/
yb...@google.com <yb...@google.com> #8
actually i have a CL that makes this work for java as well but may not work for release builds (didn't try)
but it is shady, uses private APi and someday will break.
on the other hand, kotlin version seems to make sense, I'll ask kotlin folks to see if they have any plans to open it up.
but it is shady, uses private APi and someday will break.
on the other hand, kotlin version seems to make sense, I'll ask kotlin folks to see if they have any plans to open it up.
yb...@google.com <yb...@google.com> #9
we've added support for kotlin using kotlin-metadata. will go out in 1.1 alpha 2
za...@gmail.com <za...@gmail.com> #10
I don't think this is really fixed. Room will still always pick the no-arg constructor rather than the primary constructor if one is found, which means you can't use immutable `val` dependencies. Taken up in https://issuetracker.google.com/issues/105769985 though
za...@gmail.com <za...@gmail.com> #11
Or more specifically, you can't have nullable val properties (not dependencies, misspoke earlier). If I have a class with all val properties, it works fine
Description
Version used: 1.0.0-beta1
Devices/Android versions reproduced on: N/A compilation
Demo project:
Details for trying the different working/nonworking conditions are in the README