-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #4006: Avoid ambiguity between SHAREDterm cases and finally #4017
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
32dfd56
to
fd76449
Compare
Added description of the issue in #4006 |
@@ -58,6 +58,7 @@ class CompilationTests extends ParallelTesting { | |||
compileFile("tests/pos-special/i3323.scala", defaultOptions.and("-Xfatal-warnings")) + | |||
compileFile("tests/pos-special/i3323b.scala", defaultOptions.and("-Xfatal-warnings")) + | |||
compileFile("tests/pos-special/i3589-b.scala", defaultOptions.and("-Xfatal-warnings")) + | |||
compileFile("tests/pos-special/i4006.scala", defaultOptions.and("-Ytest-pickler")) + |
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 not put the test in tests/pickling
?
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.
Yes
withLength { | ||
pickleTree(block) | ||
cases.foreach(pickleTree) | ||
if (!finalizer.isEmpty) writeByte(FINALLY); pickleTreeUnlessEmpty(finalizer) |
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.
if (!finalizer.isEmpty) {
writeByte(FINALLY)
pickleTree(finalizer)
}
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 completely rewrite this code
9ce2e21
to
2268942
Compare
@@ -1021,7 +1021,12 @@ class TreeUnpickler(reader: TastyReader, | |||
val expr = ifBefore(end)(readTerm(), EmptyTree) | |||
Return(expr, Ident(from.termRef)) | |||
case TRY => |
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.
Maybe, also add a test with no finally
to exercise this path. I found tests for try ... catch
but not within inline def
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.
Added
Oops, didn't mean to request changes
I think we should not add a new format tag. Tasty cases are a precious resource - the more we add the more people will get the impression that this is a complex format and will not work with it. I suppose we can use |
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 think we should not add a new format tag. Tasty cases are a precious resource - the more we add the more people will get the impression that this is a complex format and will not work with it.
I suppose we can use unsharedTag instead to get a robust disambiguation?
8181ab8
to
ad28c3f
Compare
Reimplemented fix using unsharedTag
No description provided.