--- /opt/cvs/dotgnu/pnet/cscc/csharp/cs_stmt.tc Tue Aug 13 22:36:40 2002 +++ cscc/csharp/cs_stmt.tc Fri Aug 30 20:40:28 2002 @@ -323,6 +323,17 @@ has the same type as the array elements. We can optimise this case in the code generator to scan the array efficiently */ } + else if(ILType_IsSimpleArray(node->arrayType) && !( + ILTypeIdentical(node->elemType, type))) + { + /* The collection is a simple array but the iteration variable + has a different type . Need to confirm if I need to check + Coerce or Cast here . + */ + CCErrorOnLine(yygetfilename(node), yygetlinenum(node), + "Cannot loop through '%s' using '%s' variables", + CSTypeToName(node->arrayType),CSTypeToName(type)); + } else if(ILTypeIsStringClass(node->arrayType) && ILTypeIdentical(type, ILType_Char)) {