Skip to content
New issue

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

[KSP2] Symbols appear missing from getSymbolsWithAnnotation of a TYPE_USE annotation #2374

Open
dx404 opened this issue Mar 12, 2025 · 1 comment

Comments

@dx404
Copy link
Collaborator

dx404 commented Mar 12, 2025

We have a java annotation, say

MyAnnatation.java

package com.example;

@Documented
@Retention(CLASS)
@Target(TYPE_USE)
public @interface MyAnnatation {}

Workload.kt

package com.example

interface Hoo

interface Koo

class Foo : 
@MyAnnatation Hoo,
@MyAnnatation Koo { }

Use:

 val symbols = resolver.getSymbolsWithAnnotation(MyAnnatation::class.java.name).toList()

Expected Results

[Hoo, Koo]

Actual Results:

[] // empty
``

@dx404 dx404 changed the title [KSP2] Symbols appears missing from agetSymbolsWithAnnotation of a TYPE_USE annotation [KSP2] Symbols appears missing from getSymbolsWithAnnotation of a TYPE_USE annotation Mar 12, 2025
@dx404 dx404 changed the title [KSP2] Symbols appears missing from getSymbolsWithAnnotation of a TYPE_USE annotation [KSP2] Symbols appear missing from getSymbolsWithAnnotation of a TYPE_USE annotation Mar 12, 2025
@dx404
Copy link
Collaborator Author

dx404 commented Mar 18, 2025

As discussed offline. This behavior works as intended. Due to performance reasons, symbols are not expected to be obtained through type annotations for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant