-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Do not set/reset flags that are part of FromStartFlags/AfterLoadFlags #4202
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
Ah, but 0ebf36b happens in a treetransformer, so whether or not Mutable is FromStartFlags does not make a difference here I think. Here are the remaining flag mutations I believe are problematic but didn't know how to fix:
The following are also problematic but are only used to do error recovery so maybe ok (EDIT: decided they were indeed ok): |
b2816d3
to
2a71214
Compare
Yes, the context was indeed to simplify the work of the Scala.js back-end, because in the IR it is absolutely forbidden to mutate a Using an indirect test would be fine too, as long as it's reliable. But then you'll need to tell -Ycheck that mutating a mixed-in |
@@ -454,17 +454,18 @@ object Flags { | |||
/** Flags representing access rights */ | |||
final val AccessFlags = Private | Protected | Local | |||
|
|||
/** Flags guaranteed to be set upon symbol creation */ | |||
/** Flags that are not (re)set when completing the denotation */ |
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 both the old and the new comment are useful. Can we combine them?
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 the old comment is misleading. These flags are not guaranteed to be set upon symbol creation, as can be witnessed by them appearing in setFlag/resetFlag calls in various places. I think that correctness only requires them to not appear in completers and InfoTransformers, but they're free to appear in other places such as TreeTransformers (e.g, the setFlag(Mutable)
in Memoize I mentioned above).
/** Flags guaranteed to be set upon symbol creation, or, if symbol is a top-level | ||
* class or object, when the class file defining the symbol is loaded (which | ||
* is generally before the symbol is completed | ||
/** Flags that are not (re)set when completing the denotation, or, if symbol is |
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.
Same here
fde700c
to
228678b
Compare
Method is part of FromStartFlags
We now explicitly pickle the fact that they're param setters so that we can set the flag ParamAccessor at symbol creation, this is necessary because ParamAccessor is a FromStarts flag. Since this change isn't binary-compatible, bump TASTY to 6.0.
228678b
to
94a3cf2
Compare
I've opened #4221 to follow-up on the remaining issues. |
No description provided.