This issue seems similar to #2325.
Consider the following source:
class Subject(val param: MyAlias<String>)
typealias MyAlias<T> = Foo<Bar<T>, Baz<T>>
class Foo<T1, T2>
class Bar<T>
class Baz<T>
With the following processor logic:
val subjectName = resolver.getKSNameFromString("Subject")
val subject = resolver.getClassDeclarationByName(subjectName)!!
val property = subject.getDeclaredProperties().single()
val propertyType = property.type.resolve()
println("${property.simpleName}: ${propertyType.declaration}: $propertyType")
Results in:
BACKEND: KSP1
param: MyAlias: [typealias MyAlias]<String>
BACKEND: KSP2
param: MyAlias: Foo<Bar<String>, Baz<String>>
The issue is that in KSP2, the KSPropertyDeclaration#type is expanded (i.e. no longer contains the type alias), but its KSType#declaration is a type alias. I would expect the type and its declaration to align as it does in KSP1.
This issue seems similar to #2325.
Consider the following source:
With the following processor logic:
Results in:
The issue is that in KSP2, the
KSPropertyDeclaration#typeis expanded (i.e. no longer contains the type alias), but itsKSType#declarationis a type alias. I would expect the type and its declaration to align as it does in KSP1.