Skip to content

Collect package and block imports in TreeMapWithImplicits #11548

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

Closed
wants to merge 2 commits into from

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Feb 26, 2021

Fixes #11538
Fixes #11557

@nicolasstucki nicolasstucki self-assigned this Feb 26, 2021
@nicolasstucki nicolasstucki marked this pull request as ready for review March 1, 2021 07:58
@nicolasstucki nicolasstucki requested a review from odersky March 1, 2021 07:58
@nicolasstucki nicolasstucki added this to the 3.0.0-RC2 milestone Mar 1, 2021
@nicolasstucki nicolasstucki changed the title Collect package imports in TreeMapWithImplicits Collect package and block imports in TreeMapWithImplicits Mar 1, 2021
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.

In fact, it would be better make transformStats override the one in TreeMap.

private def nestedPackageScopeCtx(tree: PackageDef)(using Context): Context =
importScopeCtx(tree.stats)(using ctx.withOwner(tree.symbol))

private def importScopeCtx(stats: List[Tree])(using Context): Context =
Copy link
Contributor

Choose a reason for hiding this comment

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

That's not exactly what Namer and Typer does. An import is visible only after it is defined.

@nicolasstucki
Copy link
Contributor Author

Replaced by #11591

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.

Expr.summon does not work with imported givens from a class instance summonFrom and summon use different scopes for implicit search
2 participants