Status Update
Comments
bc...@google.com <bc...@google.com> #2
there are some image for help
bc...@google.com <bc...@google.com> #3
hello?
bc...@google.com <bc...@google.com> #4
Release 2.1.10-1.0.31 contained fixes for
This fixed all but 2 remaining signatures in KSTypeNamesGoldenTest for KSP2 (see
bc...@google.com <bc...@google.com> #5
I spent some time looking into the 2 remaining KSP2 signatures that don't match KAPT.
This is definitely due to a discrepancy between KSP1 and KSP2, but IMO KSP2 has the correct behavior.
Consider the case below:
fun method(): MyAlias
alias MyAlias = @JvmSuppressWildcards List<Foo>
interface Foo
In KSP1, the return type, MyAlias
, has the @JvmSuppressWildcards
annotation.
In KSP2, the return type does not have the @JvmSuppressWildcards
annotation. Instead, it's on the aliased type, List<Foo>
.
Since KSP2's behavior aligns better with the actual annotations in source code I think KSP2's behavior is more correct. Thus, rather than filing a KSP bug for this, I'm going to update XProcessing's code to work with the new behavior in KSP2.
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
Author: bcorso <
Link:
Fix KSTypeVarianceResolver for typealias with @JvmSuppressWildcards.
Expand for full commit details
Fix KSTypeVarianceResolver for typealias with @JvmSuppressWildcards.
In KSP1, @JvmSuppressWildcards annotation was copied from the type being
aliased to the typealias itself. However, in KSP2, that does not happen.
The KSP2 behavior actually seems more correct, so rather than file a
KSP bug, I think we should fix this in XProcessing. In particular,
XProcessing shouldn't rely on the incorrect KSP1 behavior to work, so I've
updated the code to keep track of the annotations manually to make things
work with KSP2.
I've also removed a workaround for https://github.com/google/ksp/issues/1376
which is has been fixed in KSP for a while now.
Bug: 394692559
Test: KSTypeNamesGoldenTest.kt
Change-Id: Id1abbbac330c334a2ee6493d6e78e609e0c0c404
Files:
- M
room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KSTypeExt.kt
- M
room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KSTypeVarianceResolver.kt
- M
room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/ksp/KspTypeNamesGoldenTest.kt
Hash: 6abd916f4b6cd63490fad17c543d8d188e03ed54
Date: Fri Feb 28 16:59:39 2025
Description
This test was never enabled with KSP2 due to known issues (https://github.com/google/ksp/issues/1930 ) but that issue is now closed.
We should enable this test for KSP2 (initially exempting any failures) to prevent regressions and track progress towards.