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

retrieve annotations for KSType from KotlinType instead of KSTypeReference #1101

Merged
merged 1 commit into from Sep 13, 2022

Conversation

neetopia
Copy link
Collaborator

@neetopia neetopia commented Sep 9, 2022

fixes #985

several open questions:

  • defining annotations origin for KSType is tricky, as type is not part of source code. with this PR actually all annotation origins from KSType becomes library, which I actually found more meaningful, but this can be breaking change.
  • since KotlinType.annotations contains the full picture of the actual annotations of a kotlin type, the annotations parameter in getKSTypeCached is no longer necessary, might want to clean up in a future patch.

@ting-yuan
Copy link
Collaborator

IIRC the first point you mentioned is the reason why the annotations are passed in. Another reason is that it was a (premature) optimization. To keep the behavior untouched, there are two approaches:

  1. Fix call sites of getKSTypeCached.
  2. Try to find PSIs for those annotations.

@neetopia neetopia force-pushed the function-type-annotation-extension branch from ad95fbb to bc8e647 Compare September 13, 2022 20:50
@neetopia
Copy link
Collaborator Author

sounds good, updated to not add from descriptor for annotations with actual source.

@neetopia neetopia merged commit 3d29c22 into google:main Sep 13, 2022
@neetopia neetopia deleted the function-type-annotation-extension branch September 13, 2022 23:54
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

Successfully merging this pull request may close these issues.

No "kotlin.ExtensionFunctionType" annotation on functional types with receivers
2 participants