+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
}
}
- 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
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));
}
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;