Fixed
Status Update
Comments
da...@google.com <da...@google.com> #2
Ups! This is an error in the codegen, we'll get it fixed.
el...@google.com <el...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 518e73fae76c508ef0c9d053f075aca55fbca3c9
Author: elifbilgin <elifbilgin@google.com>
Date: Thu May 30 12:53:05 2024
Resolve invalid code generation in iOS.
When a Map with a value of type List was encountered in Kotlin codegen,
it was incorrectly getting initialized as a new ArrayList instance. The
same issue was discovered when using Set value types as well. This CL fixes
both issues by utilizing the appropriate `mutableListOf()` and
`mutableSetOf()` functions in code generation.
Bug: 340983093
Test: BaseQueryTest.kt
Change-Id: If1404d0b3a5da5a2fd03dd89c3dc282f9b54138f
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapValueResultAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map_ambiguousIndexAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap_ambiguousIndexAdapter.kt
https://android-review.googlesource.com/3109558
Branch: androidx-main
commit 518e73fae76c508ef0c9d053f075aca55fbca3c9
Author: elifbilgin <elifbilgin@google.com>
Date: Thu May 30 12:53:05 2024
Resolve invalid code generation in iOS.
When a Map with a value of type List was encountered in Kotlin codegen,
it was incorrectly getting initialized as a new ArrayList instance. The
same issue was discovered when using Set value types as well. This CL fixes
both issues by utilizing the appropriate `mutableListOf()` and
`mutableSetOf()` functions in code generation.
Bug: 340983093
Test: BaseQueryTest.kt
Change-Id: If1404d0b3a5da5a2fd03dd89c3dc282f9b54138f
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapValueResultAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map_ambiguousIndexAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap_ambiguousIndexAdapter.kt
Description
Version used: 2.7.0-alpha01/02
Sample project:
Add the following Relation
```
@Query(
"""
SELECT * FROM team
JOIN player ON
""",
)
fun teamsWithPlayers(): Flow<Map<Team, List<Player>>>
```
I wanted to use Multimap return types
to workaround issue