**** Merged r39428-r39544 from MCS ****
authorMartin Baulig <martin@novell.com>
Wed, 26 Jan 2005 07:40:12 +0000 (07:40 -0000)
committerMartin Baulig <martin@novell.com>
Wed, 26 Jan 2005 07:40:12 +0000 (07:40 -0000)
svn path=/trunk/mcs/; revision=39545

mcs/gmcs/ChangeLog
mcs/gmcs/attribute.cs
mcs/gmcs/expression.cs

index ca0da40c65d594d8e2fdf0f38429ae0135f5c2be..f3c9de3bbe548e3c6057de557d638bb9455461f6 100644 (file)
@@ -1,3 +1,17 @@
+2005-01-25  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #71602.
+       * expression.cs (MemberAccess.DoResolve): Don't complain with
+       cs0572 when the LHS of a member access has identical name and type
+       name.
+
+2005-01-25  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #71651, #71675
+       * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
+       CreatePermission.
+       Create custom PermissionSet only for PermissionSetAttribute.
+
 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
 
        Fix #71649
index e0e81083ffc78c44d58d1cd899e244cf5e3b000f..30d6a61dcced525a185d747c6f7662f4d3588d41 100644 (file)
@@ -819,7 +819,14 @@ namespace Mono.CSharp {
                                }
                        }
 
-                       IPermission perm = sa.CreatePermission ();
+                       IPermission perm;
+                       try {
+                               perm = sa.CreatePermission ();
+                       }
+                       catch (Exception e) {
+                               Error_AttributeEmitError (String.Format ("{0} was thrown during attribute processing: {1}", e.GetType (), e.Message));
+                               return;
+                       }
                        SecurityAction action = GetSecurityActionValue ();
 
                        // IS is correct because for corlib we are using an instance from old corlib
@@ -839,7 +846,11 @@ namespace Mono.CSharp {
 
                        PermissionSet ps = (PermissionSet)permissions [action];
                        if (ps == null) {
-                               ps = new PermissionSet (sa.Unrestricted ? PermissionState.Unrestricted : PermissionState.None);
+                               if (sa is PermissionSetAttribute)
+                                       ps = new PermissionSet (sa.Unrestricted ? PermissionState.Unrestricted : PermissionState.None);
+                               else
+                                       ps = new PermissionSet (PermissionState.None);
+
                                permissions.Add (action, ps);
                        } else if (!ps.IsUnrestricted () && sa.Unrestricted) {
                                ps = ps.Union (new PermissionSet (PermissionState.Unrestricted));
index b0874849ab475668c0f4777ea4985a4db54cdae8..75eae92558a830aacd37bb6cc744a2d3909f9cea 100644 (file)
@@ -7526,7 +7526,8 @@ namespace Mono.CSharp {
                        }
 
                        if (member_lookup is TypeExpr) {
-                               if (!(expr is TypeExpr)) {
+                               if (!(expr is TypeExpr) && 
+                                   !IdenticalNameAndTypeName (ec, original, expr, loc)) {
                                        Error (572, "Can't reference type `" + Identifier + "' through an expression; try `" +
                                               member_lookup.Type + "' instead");
                                        return null;