Skip to content

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

Closed
wants to merge 4 commits into from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 23, 2020

Store the parameter symbols of a method in a paramss
field of the method symbol.

Parameter symbols are kept up-to-date until erasure.

/** 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
Copy link
Member

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 ?

Copy link
Contributor

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.

Copy link
Member

@smarter smarter left a 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)

@odersky
Copy link
Contributor Author

odersky commented Mar 24, 2020

@smarter See new commit message on b6f1ea5

@smarter
Copy link
Member

smarter commented Mar 24, 2020

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.

@odersky
Copy link
Contributor Author

odersky commented Mar 24, 2020

@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.

odersky added 3 commits March 29, 2020 17:33
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.
@odersky
Copy link
Contributor Author

odersky commented Mar 30, 2020

Subsumed by #8637.

@odersky odersky closed this Mar 30, 2020
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.

3 participants