Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
May 30, 2018

Conversation

retronym
Copy link
Member

@retronym retronym commented Feb 2, 2018

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

@retronym retronym requested a review from lrytz February 2, 2018 06:53
@scala-jenkins scala-jenkins added this to the 2.13.0-M4 milestone Feb 2, 2018
@scala scala deleted a comment from retronym Feb 24, 2018
@scala scala deleted a comment from retronym Feb 24, 2018
Copy link
Member

@lrytz lrytz 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! 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()
Copy link
Member

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

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

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've added a few comments with my best reverse engineering of the intent.

@adriaanm adriaanm modified the milestones: 2.13.0-M4, 2.13.0-M5 Apr 30, 2018
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.
@retronym
Copy link
Member Author

Ping @lrytz

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.

4 participants