Repository navigation
Conversation
|
Hi @mvanhorn, thanks for the PR! Could you add a test for this first in a separate PR? See https://github.com/google/ksp/blob/main/CONTRIBUTING.md for more information :) |
|
Done, split out as #3108. That PR is tests only, no production code, and the It covers the two things around the existing case that were untested:
Current behaviour, now recorded: Both I'll rebase this PR on #3108 once it lands so the diff here is just the behaviour change plus the two new expected lines. |
…otfoundexception-but-it-does-exist-in # Conflicts: # api/src/main/kotlin/com/google/devtools/ksp/utils.kt
|
This branch had a conflict with main, so I merged main in (ca5332d). The only conflicting hunk was in Checked locally with #3108 (the tests-only PR) is still open. Once it lands I'll update this one so the diff is just the behaviour change. |
Add an experimental
getKSAnnotationsByType()utility that reuses the existing short-name and qualified-name matching logic while returningSequence<KSAnnotation>without constructing annotation proxies.KSAnnotated.getAnnotationsByType()still converts every matchingKSAnnotationinto a runtime annotation proxy.A source annotation with one
KClassmember and an array ofKClassmembers is found throughgetKSAnnotationsByType(), and the processor reads the expected qualified names from the rawKSTypeargument values without throwing; Built-in, source-declared, array, and generic array class literals remain distinguishable through the raw values, while the existing typed lookup continues to match the same annotation and retain its established proxy behavior.Fixes #1038