Skip to content

Remove variants of METHODtype tasty tag #8624

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

Merged
merged 2 commits into from
Mar 29, 2020

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented Mar 27, 2020

By swapping params to pickle types and then names, we can avoid a marker to separate names from flags. This also fixes the annoying fact that in TastyPrinter, param names were printed alongside the previous type printed, and not the associated parameter type

@bishabosha bishabosha added the area:tasty-format issues relating to TASTy as a portable standard label Mar 27, 2020
@bishabosha bishabosha requested a review from odersky March 27, 2020 17:09
@bishabosha bishabosha force-pushed the tasty/single-methodtype-tag branch from 8881361 to 4088531 Compare March 27, 2020 17:22
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should strive to make the code here as lean as possible and the meaning as clear as possible. TreeUnpickler is a core piece of language infrastructure. It is already very long. So any line of code we add has to do something essential in the clearest possible way. That's why I was more picky than usual in my review. 😉

@odersky odersky assigned bishabosha and unassigned odersky Mar 28, 2020
@odersky
Copy link
Contributor

odersky commented Mar 28, 2020

The aim of the refactoring is to be a simplification. If we end up with more lines than before, we should ask ourselves whether we missed that aim.

@bishabosha bishabosha force-pushed the tasty/single-methodtype-tag branch from 4088531 to fde9672 Compare March 29, 2020 00:40
pt => registeringType(pt, paramReader.readParamTypes[PInfo](end)),
val (paramNames, mods) = nameReader.readParamNamesAndMods(end)
companionOp(mods)(paramNames.map(nameMap))(
pt => registeringType(pt, paramReader.readParamTypes[PInfo](paramNames.length)),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was potentially concerned about traversing the paramNames to get a length versus comparing to an end address, but I guess it is insignificant compared to the logic to traverse types

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed. Generally, we assume that length is free since most lists are small.

@bishabosha bishabosha force-pushed the tasty/single-methodtype-tag branch from fde9672 to 0145620 Compare March 29, 2020 00:48
@bishabosha
Copy link
Member Author

bishabosha commented Mar 29, 2020

Thank you for the very detailed review, I think it now seems a lot cleaner, and I did forget to change the grammar documentation

@bishabosha bishabosha assigned odersky and unassigned bishabosha Mar 29, 2020
@bishabosha bishabosha requested a review from odersky March 29, 2020 01:04
@bishabosha bishabosha force-pushed the tasty/single-methodtype-tag branch from 0145620 to 73209e0 Compare March 29, 2020 01:50
@bishabosha bishabosha force-pushed the tasty/single-methodtype-tag branch from 73209e0 to c77f8e2 Compare March 29, 2020 03:01
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now. Thanks for the quick turn-around!

@odersky odersky merged commit f5c8d52 into scala:master Mar 29, 2020
@odersky odersky deleted the tasty/single-methodtype-tag branch March 29, 2020 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tasty-format issues relating to TASTy as a portable standard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants