Skip to content

Fix printed references to module types #4715

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 2 commits into from
Jun 29, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki requested a review from liufengyun June 24, 2018 12:32
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.

Otherwise, LGTM

prefix match {
case Types.EmptyPrefix() =>
case _ =>
printTypeOrBound(prefix) += "."
Copy link
Contributor

Choose a reason for hiding this comment

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

I would change this line into two lines:

printTypeOrBound(prefix)
this += "."

@@ -750,9 +750,6 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
printTypeAndAnnots(tp)
this += " "
printAnnotation(annot)
case tpe @ Type.TypeRef(name, _) if name.endsWith("$") =>
printType(tpe)
this += ".type"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the two cases below are not handled in TYPE printing as well ? Can we move the whole method printTypeAndAnnots to TYPE printing part, instead of being a local method inside TREE printing?

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.

What is the relationship between ShowSourceCode and PlainPrinter and RefinedPrinter? Is there scope for unification?

@nicolasstucki
Copy link
Contributor Author

There is no relationship between ShowSourceCode and PlainPrinter and RefinedPrinter. They are not intended to be unified.

@nicolasstucki nicolasstucki merged commit f093ba2 into scala:master Jun 29, 2018
@liufengyun liufengyun deleted the decompile-fix-module-ref branch June 30, 2018 10:45
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.

3 participants