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

Collection expressions: add spreads section #7664

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cston
Copy link
Member

@cston cston commented Nov 8, 2023

No description provided.

@cston cston requested a review from a team as a code owner November 8, 2023 19:59

The `GetEnumerator` method identified in the compile-time processing may be an extension method.

The `Current` property identified in the compile-time processing may be *ref returning*.
Copy link
Member

Choose a reason for hiding this comment

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

do we need language talking about when teh expression that is being spread is evaluated, versus when teh values are enumerated, and what guarantees there are (or are not) around that? (or does that already exist?

Copy link
Member Author

Choose a reason for hiding this comment

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

The order of evaluation should be covered in the Construction section that follows this one.

@@ -129,7 +129,7 @@ The following implicit *collection expression conversions* exist from a collecti
In the cases above, a collection expression *element* `Ei` is considered to have an *implicit conversion* to *type* `T` if:

* `Ei` is an *expression element* and there is an implicit conversion from `Ei` to `T`.
* `Ei` is a *spread element* `Si` and there is an implicit conversion from the *iteration type* of `Si` to `T`.
* `Ei` is a *spread element* and there is an implicit conversion from the *iteration type* of the spread element *collection* to `T`.
Copy link
Contributor

Choose a reason for hiding this comment

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

The term 'collection' surprises me a bit since any enumerable can be spread, and not all enumerables are collections.

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

Successfully merging this pull request may close these issues.

None yet

3 participants