You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In KSP2, if a type argument is error type (in java source file), for example Foo in ArrayList<Foo>, then the foo's KSType and KSTypeReference will appear as (<ERROR TYPE: Foo>..<ERROR TYPE: Foo>?). And there's no public API to retrieve the original simple name "Foo".
I end up have to use regex to extract the word Foo from (<ERROR TYPE: Foo>..<ERROR TYPE: Foo>?)
In KSP2, if a type argument is error type (in java source file), for example
Foo
inArrayList<Foo>
, then the foo's KSType and KSTypeReference will appear as(<ERROR TYPE: Foo>..<ERROR TYPE: Foo>?)
. And there's no public API to retrieve the original simple name "Foo".I end up have to use regex to extract the word
Foo
from(<ERROR TYPE: Foo>..<ERROR TYPE: Foo>?)
Repro
Example code in acejingbo@ba967e0
Run ksp1 (:compiler-plugin:test) you will get
Run ksp2 (:kotlin-analysis-api:test) you will get
See
NonExistClass
in ksp, but was(<ERROR TYPE: NonExistClass>..<ERROR TYPE: NonExistClass>?)
in ksp2argumentType
andresolvedArgumentType
provide no API that can return its original textNonExistClass
(ktType have it but it's not public!)
Wishlist
Is it reasonable to request an API that can return error type's simple name / original text?
Or expose the inner KtType so we can retrieve from there?
Thanks!
The text was updated successfully, but these errors were encountered: