Author: miguel
Date: 2006-08-13 23:31:44 -0400 (Sun, 13 Aug 2006)
New Revision: 63697
Added:
trunk/mcs/errors/cs1656-5.cs
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/assign.cs
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/assign.cs
Log:
2006-08-13 Miguel de Icaza <[EMAIL PROTECTED]>
* assign.cs: Catch attempts to assign to a method groups in += and
report as 1656
Added: trunk/mcs/errors/cs1656-5.cs
===================================================================
--- trunk/mcs/errors/cs1656-5.cs 2006-08-14 02:35:15 UTC (rev 63696)
+++ trunk/mcs/errors/cs1656-5.cs 2006-08-14 03:31:44 UTC (rev 63697)
@@ -0,0 +1,13 @@
+public class Test
+{
+ void Method ()
+ {
+ }
+
+ public static void Main ()
+ {
+ Test t = new Test ();
+
+ t.Method += delegate { };
+ }
+}
Property changes on: trunk/mcs/errors/cs1656-5.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-08-14 02:35:15 UTC (rev 63696)
+++ trunk/mcs/gmcs/ChangeLog 2006-08-14 03:31:44 UTC (rev 63697)
@@ -1,3 +1,8 @@
+2006-08-13 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * assign.cs: Catch attempts to assign to a method groups in += and
+ report as 1656
+
2006-08-13 Marek Safar <[EMAIL PROTECTED]>
A fix for #79056
Modified: trunk/mcs/gmcs/assign.cs
===================================================================
--- trunk/mcs/gmcs/assign.cs 2006-08-14 02:35:15 UTC (rev 63696)
+++ trunk/mcs/gmcs/assign.cs 2006-08-14 03:31:44 UTC (rev 63697)
@@ -622,6 +622,11 @@
if (target == null)
return null;
+ if (target is MethodGroupExpr){
+ Report.Error (1656, Location, "Can not assign
to {0} because it is a method group",
+ ((MethodGroupExpr) target).Name);
+ return null;
+ }
//
// Only now we can decouple the original source/target
// into a tree, to guarantee that we do not have side
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2006-08-14 02:35:15 UTC (rev 63696)
+++ trunk/mcs/mcs/ChangeLog 2006-08-14 03:31:44 UTC (rev 63697)
@@ -1,3 +1,8 @@
+2006-08-13 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * assign.cs: Catch attempts to assign to a method groups in += and
+ report as 1656
+
2006-08-13 Marek Safar <[EMAIL PROTECTED]>
A fix for #79056
Modified: trunk/mcs/mcs/assign.cs
===================================================================
--- trunk/mcs/mcs/assign.cs 2006-08-14 02:35:15 UTC (rev 63696)
+++ trunk/mcs/mcs/assign.cs 2006-08-14 03:31:44 UTC (rev 63697)
@@ -622,6 +622,11 @@
if (target == null)
return null;
+ if (target is MethodGroupExpr){
+ Report.Error (1656, Location, "Can not assign
to {0} because it is a method group",
+ ((MethodGroupExpr) target).Name);
+ return null;
+ }
//
// Only now we can decouple the original source/target
// into a tree, to guarantee that we do not have side
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches