2006-01-30 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Mon, 30 Jan 2006 22:04:11 +0000 (22:04 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 30 Jan 2006 22:04:11 +0000 (22:04 -0000)
* expression.cs: Member access is not allowed on anonymous
methods.  Fixes #77402.

svn path=/trunk/mcs/; revision=56290

mcs/errors/cs0023-4.cs [new file with mode: 0644]
mcs/gmcs/ChangeLog
mcs/gmcs/expression.cs
mcs/mcs/ChangeLog
mcs/mcs/expression.cs

diff --git a/mcs/errors/cs0023-4.cs b/mcs/errors/cs0023-4.cs
new file mode 100644 (file)
index 0000000..c39016b
--- /dev/null
@@ -0,0 +1,7 @@
+using System;
+class Test {
+       public static void Main(string[] argv) {
+               Console.WriteLine("Type of anonymous block: {0}",
+                       (delegate() {}).GetType());
+       }
+}
index 8934ee3abafcacd02052787dec1906df8110f6f3..9297e8a91c14918383851716a731712933e2f1b3 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-30  Miguel de Icaza  <miguel@novell.com>
+
+       * expression.cs: Member access is not allowed on anonymous
+       methods.  Fixes #77402.
+
 2006-01-30  Raja R Harinath  <rharinath@novell.com>
 
        Fix #77401
index df0cb3369104353415320d251cd1c8df5fb0dad9..7c56d1e04f9b2317375792f377c3a374ae4c11cd 100644 (file)
@@ -7373,12 +7373,13 @@ namespace Mono.CSharp {
                                Error (23, "The `.' operator can not be applied to pointer operands (" +
                                       TypeManager.CSharpName (expr_type) + ")");
                                return null;
-                       }
-
-                       if (expr_type == TypeManager.void_type) {
+                       } else if (expr_type == TypeManager.void_type) {
                                Error (23, "The `.' operator can not be applied to operands of type 'void'");
                                return null;
+                       } else if (expr_type == TypeManager.anonymous_method_type){
+                               Error (23, "The `.' operator can not be applied to anonymous methods");
                        }
+                       
 
                        Expression member_lookup;
                        member_lookup = MemberLookup (
index e3d08ae9a24b5a53abc858c364411f2e213da824..3e43138d86c3b839ba43e68ab2c7f519a8cb3e51 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-30  Miguel de Icaza  <miguel@novell.com>
+
+       * expression.cs: Member access is not allowed on anonymous
+       methods.  Fixes #77402.
+
 2006-01-30  Raja R Harinath  <rharinath@novell.com>
 
        Fix #77401
index f508f16e406f9fd7a2e9c21b7db799eb06ba6a28..243d16ff95211467aff6587dcc13ef255d035d59 100644 (file)
@@ -7055,12 +7055,13 @@ namespace Mono.CSharp {
                                Error (23, "The `.' operator can not be applied to pointer operands (" +
                                       TypeManager.CSharpName (expr_type) + ")");
                                return null;
-                       }
-
-                       if (expr_type == TypeManager.void_type) {
+                       } else if (expr_type == TypeManager.void_type) {
                                Error (23, "The `.' operator can not be applied to operands of type 'void'");
                                return null;
+                       } else if (expr_type == TypeManager.anonymous_method_type){
+                               Error (23, "The `.' operator can not be applied to anonymous methods");
                        }
+                       
 
                        Expression member_lookup;
                        member_lookup = MemberLookupFinal (ec, expr_type, expr_type, Identifier, loc);