-
Notifications
You must be signed in to change notification settings - Fork 388
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
Skip lambda cached field #753
Skip lambda cached field #753
Conversation
.AssertBranchesCovered(BuildConfiguration.Debug, (16, 0, 0), (16, 1, 1), (43, 0, 3), (43, 1, 1), (43, 2, 1), (43, 3, 1), (43, 4, 0)) | ||
// Real branch should be 2, we should try to remove compiler generated branch in method ContinuationNotCalled/ContinuationCalled | ||
// for Continuation state machine | ||
.ExpectedTotalNumberOfBranches(BuildConfiguration.Debug, 2); |
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.
fixed also this bug(from 4 down to 2 real branches)
|
||
// Unexpected branches - generated by compiler to cache delegate instance |
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.
fixed also this bug
return false; | ||
} | ||
|
||
private static bool SkipLambdaCachedField(Instruction instruction) |
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.
Key method
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.
LGTM
Fixes #730
The issue is related to lambda cached fields, that triggers another issue on coverage calculation.
I've also refactored a bit
GetBranchPoints
to keep code flow clear.cc: @matteoerigozzi can you take a look?