-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Defer parameter alias computation until the end of typechecking #6301
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
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! Just asking for a bit of comments.
@@ -49,6 +49,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper | |||
private val rightAssocValDefs = new mutable.AnyRefMap[Symbol, Tree] | |||
// Symbols of ValDefs for right-associative operator desugaring which are passed by name and have been inlined | |||
private val inlinedRightAssocValDefs = new mutable.HashSet[Symbol] | |||
private val superConstructorCalls: mutable.AnyRefMap[Symbol, collection.Map[Symbol, Symbol]] = perRunCaches.newAnyRefMap() |
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.
Could you add a comment for the structure of the map?
@@ -5919,6 +5917,34 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper | |||
if (phase.erasedTypes) None // OPT save the hashmap lookup in erasure type and beyond | |||
else transformed remove tree | |||
} | |||
|
|||
|
|||
/** Finish computation of param aliases after typechecking is completed */ |
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.
It would be nice to have a (very short) summary what happens with param aliases (or say where it's documented)...
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've added a few comments with my best reverse engineering of the intent.
Previously, it was done while typechecking super calls, and would fail to see the fact that a yet-to-be-typechecked super constructor itself had a parameter aliased by a grand-parent class.
Ping @lrytz |
Previously, it was done while typechecking super calls, and would fail
to see the fact that a yet-to-be-typechecked super constructor itself
had a parameter aliased by a grand-parent class.
Part of scala/scala-dev#405