Fixed
Status Update
Comments
yb...@google.com <yb...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit cecefceee86fa83c851bae1aeea709ddd3ef6b25
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Oct 09 15:57:59 2018
Use isAssignableWithoutVariance for output type converter matching.
This fixes a situation where a two-way binding converter was not
matching with a Kotlin entity since Kotlin seems to add variance to
the field type. i.e. val data : List<Foo> ends up being a field of type
List<? extends Foo>.
Bug: 111404868
Test: ./gradlew room:integration-tests:kotlintestapp:cC
Change-Id: I3c7d28b327b6ffa10e3b9f77a4859d7d6647a49b
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/TestDatabase.kt
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/vo/JavaPojo.java
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/vo/JavaPojoConverter.kt
https://android-review.googlesource.com/783749
https://goto.google.com/android-sha1/cecefceee86fa83c851bae1aeea709ddd3ef6b25
Branch: androidx-master-dev
commit cecefceee86fa83c851bae1aeea709ddd3ef6b25
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Oct 09 15:57:59 2018
Use isAssignableWithoutVariance for output type converter matching.
This fixes a situation where a two-way binding converter was not
matching with a Kotlin entity since Kotlin seems to add variance to
the field type. i.e. val data : List<Foo> ends up being a field of type
List<? extends Foo>.
Bug: 111404868
Test: ./gradlew room:integration-tests:kotlintestapp:cC
Change-Id: I3c7d28b327b6ffa10e3b9f77a4859d7d6647a49b
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/TestDatabase.kt
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/vo/JavaPojo.java
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/vo/JavaPojoConverter.kt
da...@google.com <da...@google.com>
[Deleted User] <[Deleted User]> #3
delete
da...@gmail.com <da...@gmail.com> #4
room:2.2.1
kotlin: 1.3.50
I am still getting this error for:
var formIds: List<Long> = arrayListOf(),
Fails with an error:
Cannot figure out how to save this field into database. You can consider adding a type converter for it.
private java.util.List<java.lang.Long> formIds;
but it works for:
var formIds: MutableList<Long> = arrayListOf(),
kotlin: 1.3.50
I am still getting this error for:
var formIds: List<Long> = arrayListOf(),
Fails with an error:
Cannot figure out how to save this field into database. You can consider adding a type converter for it.
private java.util.List<java.lang.Long> formIds;
but it works for:
var formIds: MutableList<Long> = arrayListOf(),
da...@gmail.com <da...@gmail.com> #5
sorry, it works for
var formIds: ArrayList<Long> = arrayListOf(),
var formIds: ArrayList<Long> = arrayListOf(),
Description
Version used: 1.1.1
Kotlin version: 1.2.51
Room can't detect the TypeConverter of a List<Model> if that Model itself is written in Java and if I convert this class to Kotlin, it works as expected!
I got this error no matter where I put the TypeConverters annotation!
error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
A project where this can be reproduced is attached!