- if (!FetchMoveNext (ec, return_type))
- return false;
-
- if (!FetchGetCurrent (ec, return_type))
+ if (TypeManager.HasElementType (return_type) || !FetchMoveNext (ec, return_type) || !FetchGetCurrent (ec, return_type)) {
+ Report.Error (202, loc, "foreach statement requires that the return type `{0}' of `{1}' must have a suitable public MoveNext method and public Current property",
+ TypeManager.CSharpName (return_type), TypeManager.CSharpSignature (mi));