The method ForEachLoopBinder.GetEnumeratorInfo has the following in it:
// The null and default literals were caught above, so anything else with a null type is a method group or anonymous function
diagnostics.Add(ErrorCode.ERR_AnonMethGrpInForEach, _syntax.Expression.Location, collectionExpr.Display);
But this is just wrong (e.g. (1, null) has no type), and in any case is incredibly fragile to future compiler changes. It should be made robust to new expression kinds that can be null.
The method
ForEachLoopBinder.GetEnumeratorInfo
has the following in it:But this is just wrong (e.g.
(1, null)
has no type), and in any case is incredibly fragile to future compiler changes. It should be made robust to new expression kinds that can be null.