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

Fix #8585: Refresh names to avoid name clashes #8665

Merged
merged 1 commit into from Apr 5, 2020

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki self-assigned this Apr 4, 2020
@nicolasstucki nicolasstucki linked an issue Apr 4, 2020 that may be closed by this pull request
@nicolasstucki nicolasstucki marked this pull request as ready for review April 5, 2020 05:16
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1409,11 +1409,26 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
private def escapedString(str: String): String = str flatMap escapedChar
}

private[this] val names = collection.mutable.Map.empty[Symbol, String]
private[this] val namesIndex = collection.mutable.Map.empty[String, Int]
Copy link
Contributor

Choose a reason for hiding this comment

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

For later optimization: instead of generating global unique names, it's sufficient to maintain unique names in the static scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I was thinking of leaving it as an external contribution for someone.

@nicolasstucki nicolasstucki merged commit 895e361 into scala:master Apr 5, 2020
@nicolasstucki nicolasstucki deleted the fix-#8585-2 branch April 5, 2020 11:21
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.

QuoteContext show can show code that does not compile
2 participants