We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug After upgrade from 1.18.1 version to 2.0.0 I started to face an issue No TypeParameter found for index T
1.18.1
2.0.0
No TypeParameter found for index T
To Reproduce I had next code:
(this.declaration as KSClassDeclaration).getAllSuperTypes().any { it.toClassName() == ITERABLE }
I started to face next issue:
KSType 'Comparable<String>' has type arguments, which are not supported for ClassName conversion. Use KSType.toTypeName().
After switching on toTypeName I face No TypeParameter found for index T
toTypeName
(this.declaration as KSClassDeclaration).getAllSuperTypes().any { it.toTypeName() == ITERABLE }
Expected behavior toTypeName should work for wide generic classes.
Additional context Maybe I don't see the reason why toTypeName requests TypeParameterResolver.
TypeParameterResolver
The text was updated successfully, but these errors were encountered:
Can you offer a minimally reproducing sample? This isn't really actionable on the current details offered
Sorry, something went wrong.
The problem is introduced here. I used toClassName for any classes. Right now it fails for generic ones. I can change this code:
toClassName
to
(this.declaration as KSClassDeclaration).getAllSuperTypes().any { (it.declaration as KSClassDeclaration).toClassName() == ITERABLE }
but it also will fail here:
sourceType.toClassName() == STRING
if sourceType is generic. It brings a lot of additional checkings.
sourceType
What we are asking for is a minimally-reproducing sample for the toTypeName crash.
I know. It's just hard to make a small sample while it happens into kotlinpoet-ksp. So, I tried to explain.
kotlinpoet-ksp
No branches or pull requests
Describe the bug
After upgrade from
1.18.1
version to2.0.0
I started to face an issueNo TypeParameter found for index T
To Reproduce
I had next code:
I started to face next issue:
After switching on
toTypeName
I faceNo TypeParameter found for index T
Expected behavior
toTypeName
should work for wide generic classes.Additional context
Maybe I don't see the reason why
toTypeName
requestsTypeParameterResolver
.The text was updated successfully, but these errors were encountered: