* ecore.cs: Custom error message for a range variable assignment.
svn path=/trunk/mcs/; revision=108118
+2008-07-17 Marek Safar <marek.safar@gmail.com>
+
+ * ecore.cs: Custom error message for a range variable assignment.
+
2008-07-16 Marek Safar <marek.safar@gmail.com>
* constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
//
if (getter == null)
return null;
- Report.Error (200, loc, "Property or indexer `{0}' cannot be assigned to (it is read only)",
- GetSignatureForError ());
+
+ if (ec.CurrentBlock.Toplevel.GetTransparentIdentifier (PropertyInfo.Name) != null) {
+ Report.Error (1947, loc, "A range variable `{0}' cannot be assigned to. Consider using `let' clause to store the value",
+ PropertyInfo.Name);
+ } else {
+ Report.Error (200, loc, "Property or indexer `{0}' cannot be assigned to (it is read only)",
+ GetSignatureForError ());
+ }
return null;
}