-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Keep track of method parameter symbols #8597
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
Conversation
/** If this is a method, the parameter symbols, by section. | ||
* Both type and value parameters are included. Empty sections are skipped. | ||
*/ | ||
final def paramss: List[List[Symbol]] = myParamss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be exposed from tasty-reflect to give access to parameter annotations. @nicolasstucki do you mind doing that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that once this is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always keep annotations on value parameters for class methods
This commit doesn't match what scalac does. I have a PR which fixes all that at #8534 which was blocked so far because I couldn't get to the annotations on method parameters and shapeless has a test that relies on that (this is what I need the tasty-reflect change I mentioned above for)
Yes, I saw the commit message. #8534 also moves the annotations to the constructor but removes them from the derived parameters to match scalac. This is the change which is blocked on this PR. If getting annotations on the constructor is important for this PR then I can integrate my PR into this PR. |
@smarter: No, it's not important right now. It's just something I noted when I went through how modifiers are copied to value parameters. For the moment all I need to do is to copy a HasDefault parameter annotation correctly. I'll roll back the last commit then. |
Store the parameter symbols of a method in a `paramss` field of the method symbol. Parameter symbols are kept up-to-date until erasure.
Add a method `paramSymss` that mirrors the type structure of a method. Rename the old `paramss` to `rawParamss` to caution against naive uses.
Subsumed by #8637. |
Store the parameter symbols of a method in a
paramss
field of the method symbol.
Parameter symbols are kept up-to-date until erasure.