-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement decompiler on Tasty #4579
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
95fb46b
to
2204b3b
Compare
2204b3b
to
fd9e7bf
Compare
Rebased |
Should we remove |
The idea is to remove the |
e67a67d
to
fe9b1a7
Compare
fe9b1a7
to
616afec
Compare
if (ctx.settings.printTasty.value) { | ||
new TastyPrinter(unit.pickled.head._2).printContents() | ||
} else { | ||
val unit = ctx.compilationUnit |
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.
unit
is no longer accessible in L40, the CI failed because of 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.
Otherwise, LGTM
|
||
case Type.TypeLambda(paramNames, paramBounds, resType) => | ||
??? | ||
} |
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 ???
in the above means they should never be reached. Maybe use a "|" pattern to combine them in one case (the variable patterns are not used, can be underscore), and add a note.
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 add a better way to handle unreachable patterns.
this += lineBreak() | ||
printCases(cases, lineBreak()) | ||
} | ||
this += lineBreak() += "}" |
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.
Do we have a test for partial functions?
Another tricky issue is extractors with implicits. Maybe add a TODO to support later.
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.
Not yet, I will add it later. The idea is to start testing all the files in test/pos
and test/run
.
@liufengyun I fixed the issues from the comments and repeated args. You should review the last 3 commits. |
LGTM |
The implementation of the decompiler must:
It does NOT need: