Skip to content
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

Track whether or not a use of a range variable is a capture. #1501

Merged
merged 4 commits into from
Mar 30, 2015

Conversation

gafter
Copy link
Member

@gafter gafter commented Mar 23, 2015

Fixes #1291

@gafter
Copy link
Member Author

gafter commented Mar 23, 2015

@jaredpar @VSadov @AlekseyTs @agocke @VladimirReshetnikov Could a couple of you review this please?

Note that the "related" VB issue #1312 will be done next, separately.

@gafter gafter added Area-Compilers 4 - In Review A fix for the issue is submitted for review. labels Mar 23, 2015
@gafter gafter self-assigned this Mar 23, 2015
@gafter gafter added this to the 1.0 (stable) milestone Mar 23, 2015
@@ -334,20 +334,25 @@ protected void Analyze(ref bool badRegion, DiagnosticBag diagnostics)
}
}

private void CheckCaptured(Symbol variable)
private void CheckCaptured(Symbol variable, Symbol underlyingVariable = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comment what is the underlyingVariable and when it should be passed in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can we use more specific type for it?

@gafter
Copy link
Member Author

gafter commented Mar 25, 2015

I've updated the PR as we had discussed. Please review.

@AlekseyTs
Copy link
Contributor

LGTM

gafter added a commit that referenced this pull request Mar 30, 2015
Track whether or not a use of a range variable is a capture.
Fixes #1291
@gafter gafter merged commit 65bdb07 into dotnet:master Mar 30, 2015
@gafter gafter deleted the fix1291 branch March 30, 2015 19:35
@gafter gafter removed the 4 - In Review A fix for the issue is submitted for review. label Mar 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C# data flow analysis incorrectly reports range variable of the from clause as captured
4 participants