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

Require that a non-terminal yield step is a record expression #213

Closed
julianhyde opened this issue Jan 14, 2024 · 0 comments
Closed

Require that a non-terminal yield step is a record expression #213

julianhyde opened this issue Jan 14, 2024 · 0 comments

Comments

@julianhyde
Copy link
Collaborator

Require that non-terminal yield steps (i.e. those that are not the last step in their from expression) is a record expression ({field = expr, field = expr, ...}).

For example,

from d in scott.dept yield d where deptno > 10

should give the error

'yield' step that is not last in 'from' must be a record expression

Note that d has record type but is not a record expression. We may allow that in future, but it's tricky for the type deduction algorithm to see that deptno is a valid field.

The following should give the same error, because yield expression has type int and tuple:

from d in scott.dept yield d.deptno yield 1;
from d in scott.dept yield (d.deptno, d.loc) yield 1;

As before, if yield is the last step it can have any kind of expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant