-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove variants of METHODtype tasty tag #8624
Conversation
8881361
to
4088531
Compare
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 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. 😉
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. |
4088531
to
fde9672
Compare
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)), |
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 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
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.
Yes, indeed. Generally, we assume that length
is free since most lists are small.
fde9672
to
0145620
Compare
Thank you for the very detailed review, I think it now seems a lot cleaner, and I did forget to change the grammar documentation |
0145620
to
73209e0
Compare
73209e0
to
c77f8e2
Compare
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.
Looks good now. Thanks for the quick turn-around!
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