Author: martin
Date: 2005-04-19 09:49:53 -0400 (Tue, 19 Apr 2005)
New Revision: 43256
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/class.cs
trunk/mcs/gmcs/decl.cs
trunk/mcs/gmcs/rootcontext.cs
trunk/mcs/gmcs/typemanager.cs
Log:
**** Merged r42622 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-04-19 13:48:51 UTC (rev 43255)
+++ trunk/mcs/gmcs/ChangeLog 2005-04-19 13:49:53 UTC (rev 43256)
@@ -1,3 +1,13 @@
+2005-04-07 Marek Safar <[EMAIL PROTECTED]>
+
+ * class.cs (PropertyMethod.Define): Check private accessor in abstract
+ property.
+
+ * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow
RequiredAttribute
+
+ * rootcontext.cs,
+ * typemanager.cs: Registered RequiredAttributeAttribute.
+
2005-04-06 Marek Safar <[EMAIL PROTECTED]>
* class.cs (VerifyMembers): Doesn't need EmitContext argument.
Modified: trunk/mcs/gmcs/class.cs
===================================================================
--- trunk/mcs/gmcs/class.cs 2005-04-19 13:48:51 UTC (rev 43255)
+++ trunk/mcs/gmcs/class.cs 2005-04-19 13:49:53 UTC (rev 43256)
@@ -6535,6 +6535,10 @@
ModFlags = method.ModFlags;
flags = method.flags;
} else {
+ if ((method.ModFlags &
Modifiers.ABSTRACT) != 0 && (ModFlags & Modifiers.PRIVATE) != 0) {
+ Report.Error (422, Location,
"{0}': abstract properties cannot have private accessors", GetSignatureForError
(container));
+ }
+
CheckModifiers (container, ModFlags);
ModFlags |= (method.ModFlags &
(~Modifiers.Accessibility));
ModFlags |= Modifiers.PROPERTY_CUSTOM;
Modified: trunk/mcs/gmcs/decl.cs
===================================================================
--- trunk/mcs/gmcs/decl.cs 2005-04-19 13:48:51 UTC (rev 43255)
+++ trunk/mcs/gmcs/decl.cs 2005-04-19 13:49:53 UTC (rev 43256)
@@ -1108,6 +1108,10 @@
public override void ApplyAttributeBuilder (Attribute a,
CustomAttributeBuilder cb)
{
+ if (a.Type == TypeManager.required_attr_type) {
+ Report.Error (1608, a.Location, "The
RequiredAttribute attribute is not permitted on C# types");
+ return;
+ }
TypeBuilder.SetCustomAttribute (cb);
}
Modified: trunk/mcs/gmcs/rootcontext.cs
===================================================================
--- trunk/mcs/gmcs/rootcontext.cs 2005-04-19 13:48:51 UTC (rev 43255)
+++ trunk/mcs/gmcs/rootcontext.cs 2005-04-19 13:49:53 UTC (rev 43256)
@@ -402,7 +402,8 @@
"System.InvalidOperationException",
"System.NotSupportedException",
"System.MarshalByRefObject",
- "System.Security.CodeAccessPermission"
+ "System.Security.CodeAccessPermission",
+
"System.Runtime.CompilerServices.RequiredAttributeAttribute"
};
foreach (string cname in classes_second_stage)
Modified: trunk/mcs/gmcs/typemanager.cs
===================================================================
--- trunk/mcs/gmcs/typemanager.cs 2005-04-19 13:48:51 UTC (rev 43255)
+++ trunk/mcs/gmcs/typemanager.cs 2005-04-19 13:49:53 UTC (rev 43256)
@@ -97,6 +97,7 @@
static public Type struct_layout_attribute_type;
static public Type field_offset_attribute_type;
static public Type security_attr_type;
+ static public Type required_attr_type;
///
/// .NET 2.0
@@ -1178,6 +1179,7 @@
struct_layout_attribute_type = CoreLookupType
("System.Runtime.InteropServices.StructLayoutAttribute");
field_offset_attribute_type = CoreLookupType
("System.Runtime.InteropServices.FieldOffsetAttribute");
security_attr_type = CoreLookupType
("System.Security.Permissions.SecurityAttribute");
+ required_attr_type = CoreLookupType
("System.Runtime.CompilerServices.RequiredAttributeAttribute");
InitGenericCoreTypes ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches