-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Don't lift the argument of a synchronized
block in scoverage
#16941
Conversation
f97a640
to
7930004
Compare
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'm not 100% sure why it was vals
instead of defs
in the first place. I also can't think of anything wrong with this, but just to make sure I also tagged @TheElectronWill on this. However it's a LGTM from me. Thanks!
Will every argument be turned into a def, in all circumstances? I'm a bit worried about the performance and size overhead of that. |
Isn't this changing the evaluation semantics? |
From the test case, it seems that the failure is on a by-name argument. If so changing the binding of that by-name argument to a |
@KacperFKorban is it possible to just make this change and only use |
Any updates on this? |
Sorry, this PR got a bit buried for me. |
I am not sure whether lifting to defs would break the semantics, i.e. whether we can guarantee used exactly once. Probably we can't. I would feel very nervous with such a change. Also lifting to defs certainly will make the code go much slower in many cases. |
It should not. We already do that for by-name arguments of inline definitions.
It is referenced once at the call site, but possibly evaluated many times in the function. |
In this case, lifting the by-name argument into a |
As far as I know, cbn arguments are already lifted into defs. It's just cbv arguments that are lifted into vals. |
possible fix for lampepfl#16940
7930004
to
17684c5
Compare
synchronized
block in scoverage
Ok. In that case, I changed this fix to just avoid lifting arguments of |
@nicolasstucki does this look ok now? |
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 that makes sense.
possible fix for lampepfl#16940