-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Print decompiled refinements #4698
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.
Otherwise, LGTM
@@ -74,6 +74,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty | |||
|
|||
if (flags.isObject) this += "object " += name.stripSuffix("$") | |||
else if (flags.isTrait) this += "trait " += name | |||
else if (flags.isAbstract) this += "abstract class " += name | |||
else this += "class " += name |
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.
sealed
, final
and access modifiers are missing here.
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.
final
is a few lines above. I will add sealed
.
if (!sym.flags.isLocal) { | ||
printType(prefix) | ||
this += "." | ||
} |
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 seems it is also OK to print the prefix here? For hygiene, we do need to print the prefix for local members as well.
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.
This is to not print prefixes in references inside the parents of a class.
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 please explain what do you mean by prefixes in references inside the parents of a class
? I see in the code C.this.T
becomes T
, which may be unhygienic.
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 will reprint the prefix and add test cases where this fails
this += ": " | ||
printType(tp) | ||
} | ||
printMethodicType(info) |
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'd refactor the case Refinement
into a method, as it's too fat.
It seems to be neater if printMethodicType
is only called from the first case of patmat on info
.
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.
Will refactor
printMethodicTypeParams(paramNames, params) | ||
this += ") => " | ||
printTypeOrBound(body) | ||
|
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.
Why is this necessary? I assume method types are handled already in refinement case.
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.
As far as I can see we do not need it. I will remove it.
No description provided.