Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #3
hmm i think we are becoming too eager when trying to detect the common mistake of putting relations into constructors.
Thanks for the report.
Thanks for the report.
sk...@gmail.com <sk...@gmail.com> #5
Hooray! Thanks for the quick fix! This bug was preventing me from updating to the 1.1.0 versions of Room and Lifecycles.
Description
Version used: 1.1.0-alpha1
Devices/Android versions reproduced on: Compiled with API 27
This worked with Room 1.0.0, but now fails probably because it doesn't look past the first constructor when searching for one to use.
```
data class MyComplexClass @JvmOverloads constructor(
@field:Relation(parentColumn = "uid", entityColumn = "uid", entity = OtherThing::class)
var otherThings: Set<OtherThing> = setOf(),
@field:Embedded
val mainThing: MainThing)
```
Now it fails the build with `Error:(70, 2) error: Fields annotated with @Relation cannot be constructor parameters. These values are fetched after the object is constructed.` even though there is a valid constructor that only accepts a `MainThing` object and a valid setter that sets the `@Relation` field.