Skip to content

Commit 8d07381

Browse files
authored
Add back "of expression" (#1422)
See #672 (comment) /cc @RikkiGibson @jnm2
1 parent 72e0c59 commit 8d07381

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

standard/statements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ The compile-time processing of a `foreach` statement first determines the ***col
11161116

11171117
The determination is similar for the synchronous and asynchronous versions. Different interfaces with different methods and return types distinguish the synchronous and asynchronous versions. The general process proceeds as follows. Names within ‘«’ and ‘»’ are placeholders for the actual names for synchronous and asynchronous iterators. The types allowed for «GetEnumerator», «MoveNext», «IEnumerable»\<T>, «IEnumerator»\<T>, and any other distinctions are detailed in [§13.9.5.2](statements.md#13952-synchronous-foreach) for a synchronous `foreach` statement, and in [§13.9.5.3](statements.md#13953-await-foreach) for an asynchronous `foreach` statement.
11181118

1119-
1. Determine whether the type `X` has an appropriate «GetEnumerator» method:
1119+
1. Determine whether the type `X` of *expression* has an appropriate «GetEnumerator» method:
11201120
1. Perform member lookup on the type `X` with identifier «GetEnumerator» and no type arguments. If the member lookup does not produce a match, or it produces an ambiguity, or produces a match that is not a method group, check for an enumerable interface as described in step 2. It is recommended that a warning be issued if member lookup produces anything except a method group or no match.
11211121
1. Perform overload resolution using the resulting method group and an empty argument list. If overload resolution results in no applicable methods, results in an ambiguity, or results in a single best method but that method is either static or not public, check for an enumerable interface as described below. It is recommended that a warning be issued if overload resolution produces anything except an unambiguous public instance method or no applicable methods.
11221122
1. If the return type `E` of the «GetEnumerator» method is not a class, struct or interface type, produce an error and take no further steps.

0 commit comments

Comments
 (0)