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

Could not extract location from getSealedSubclasses declaration #936

Closed
midery opened this issue Apr 6, 2022 · 2 comments · Fixed by #981
Closed

Could not extract location from getSealedSubclasses declaration #936

midery opened this issue Apr 6, 2022 · 2 comments · Fixed by #981
Assignees
Labels
bug Something isn't working
Milestone

Comments

@midery
Copy link

midery commented Apr 6, 2022

We use KSP to analyze all classes in module and file location for each class is crucial.
However, if we try to do something like:

classDeclaration
  .getSealedSubclasses()
  .forEach { sealedClass ->
    sealedClass.location //or sealedClass.parentDeclaration.containingFile
  }

We will get NonExistLocation or null.
Is it an expected behavior or could it be fixed in the future?

@neetopia
Copy link
Collaborator

neetopia commented Apr 7, 2022

Is your sealed sub classes in source code or from another module/library? Location is only available for symbols on the current compile module.

@midery
Copy link
Author

midery commented Apr 11, 2022

In this scenario, sealed sub classes were located in source code from current module

@neetopia neetopia self-assigned this May 3, 2022
@neetopia neetopia added the bug Something isn't working label May 3, 2022
@neetopia neetopia added this to the 1.0.6 milestone May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants