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

Remove variants of METHODtype tasty tag #8624

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

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala Outdated Show resolved Hide resolved
tasty/src/dotty/tools/tasty/TastyFormat.scala Outdated Show resolved Hide resolved
tasty/src/dotty/tools/tasty/TastyFormat.scala Outdated Show resolved Hide resolved
@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.

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

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.

None yet

2 participants