Revert "[KSP2] Retain variances in Java type names"
This reverts commit fa437a3281d59bd2949c6071cfab588380f95a96.
Reason for revert: This change seems to be causing issues in Dagger. Reverting to see if it's the culprit.
Change-Id: Iee30429cdb2cd897a726694d24a8200fea617a06
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspType.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspType.kt
index 18ce9fa..8c0aeb1 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspType.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspType.kt
@@ -72,20 +72,8 @@
*/
private val xTypeName: XTypeName by lazy {
val jvmWildcardType = env.resolveWildcards(typeAlias ?: ksType, scope).let {
- if (ksType == it) {
- if (ksType.arguments != it.arguments) {
- // Replacing the type arguments to retain the variances resolved in
- // `resolveWildcards`. See https://github.com/google/ksp/issues/1778.
- copy(
- env = env,
- ksType = ksType.replace(it.arguments),
- originalKSAnnotations = originalKSAnnotations,
- scope = scope,
- typeAlias = typeAlias
- )
- } else {
- this
- }
+ if (it == ksType) {
+ this
} else {
env.wrap(
ksType = it,