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

Expression variables not allowed in query clauses #15910

Closed
gafter opened this issue Dec 14, 2016 · 1 comment · Fixed by #16081
Closed

Expression variables not allowed in query clauses #15910

gafter opened this issue Dec 14, 2016 · 1 comment · Fixed by #16081
Assignees
Labels
Area-Compilers Bug New Language Feature - Out Variable Declaration Out Variable Declaration New Language Feature - Pattern Matching Pattern Matching New Language Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@gafter
Copy link
Member

gafter commented Dec 14, 2016

(According to the LDM meeting just finished) In C# 7, we will not permit expression variables to be used in a sub-expression within a query clause that is translated into a lambda body. This is intended to preserve the future possibility of raising some of them to new range variables, as requested in #15619, to support scenarios such as

var result = from o in values
    where o is int i
    select i;
@gafter
Copy link
Member Author

gafter commented Dec 14, 2016

/cc @jaredpar @dotnet/roslyn-compiler This is an additional work item for C# 7.

@gafter gafter self-assigned this Dec 16, 2016
gafter added a commit to gafter/roslyn that referenced this issue Dec 23, 2016
Fixes dotnet#15910
Also fixes a sequence point issue with the let expression. Specifically, the source range for the query lambda included more than the expression of the let, but included the entire query clause. It now includes only the expression, like other query clauses.
@gafter gafter added 4 - In Review A fix for the issue is submitted for review. and removed 3 - Working labels Dec 25, 2016
gafter added a commit to gafter/roslyn that referenced this issue Dec 29, 2016
@gafter gafter added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Dec 30, 2016
gafter added a commit that referenced this issue Dec 30, 2016
Fixes #15910
Also fixes a sequence point issue with the let expression. Specifically, the source range for the query lambda included more than the expression of the let, but included the entire query clause. It now includes only the expression, like other query clauses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug New Language Feature - Out Variable Declaration Out Variable Declaration New Language Feature - Pattern Matching Pattern Matching New Language Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant