Assigned
Status Update
Comments
yb...@google.com <yb...@google.com> #2
there are some image for help
ku...@google.com <ku...@google.com> #3
hello?
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: Kuan-Ying Chou <
Link:
Cache all created type elements
Expand for full commit details
Cache all created type elements
Limit usage of `KspTypeElement.create()` to `XTypeElementStore` so that we won't create duplicated type elements.
Bug: 381290833
Test: existing tests still pass
Change-Id: I307c93b98a6c376d3b3bf1eac5c2b717337672a3
Files:
- M
room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspEnumEntry.kt
- M
room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspProcessingEnv.kt
- M
room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspRoundEnv.kt
Hash: 6720bfdf9b5b6f5023dbe4dceb29937c0bd69f86
Date: Thu Nov 28 19:00:34 2024
ku...@google.com <ku...@google.com> #5
I submitted a fix for the first issue where we get duplicated type element. For the second one I think we'll need a way to reproduce as XProcessing does return error types in our non-KMP tests.
yb...@google.com <yb...@google.com> #6
yea, this is happening in JS (returning Any for non-existing classes), we may need to enhance the test infra to support js for future similar problem :/.
thanks for the fix!
Description
```
override val superClass: XType? by lazy {
val anyTypeElement = env.requireTypeElement(Any::class)
```
check we have in KspTypeElement does not work on js
I don't have an handy repro but hit this while trying to run room in js over this db file:
a simple workaround like this seems to work but we likely want to understand why we end up with 2 Any types:
```
override val superClass: XType? by lazy {
val anyTypeElement = env.requireTypeElement(Any::class)
if (isInterface()) {
// interfaces don't have super classes (they do have super types)
null
} else if (this == anyTypeElement || this.qualifiedName == "kotlin.Any") {
null
}
...
```