Author: marek
Date: 2005-04-07 02:56:38 -0400 (Thu, 07 Apr 2005)
New Revision: 42622

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/class.cs
   trunk/mcs/mcs/decl.cs
   trunk/mcs/mcs/rootcontext.cs
   trunk/mcs/mcs/typemanager.cs
Log:
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.

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-04-07 05:45:31 UTC (rev 42621)
+++ trunk/mcs/mcs/ChangeLog     2005-04-07 06:56:38 UTC (rev 42622)
@@ -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/mcs/class.cs
===================================================================
--- trunk/mcs/mcs/class.cs      2005-04-07 05:45:31 UTC (rev 42621)
+++ trunk/mcs/mcs/class.cs      2005-04-07 06:56:38 UTC (rev 42622)
@@ -6068,6 +6068,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/mcs/decl.cs
===================================================================
--- trunk/mcs/mcs/decl.cs       2005-04-07 05:45:31 UTC (rev 42621)
+++ trunk/mcs/mcs/decl.cs       2005-04-07 06:56:38 UTC (rev 42622)
@@ -956,6 +956,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/mcs/rootcontext.cs
===================================================================
--- trunk/mcs/mcs/rootcontext.cs        2005-04-07 05:45:31 UTC (rev 42621)
+++ trunk/mcs/mcs/rootcontext.cs        2005-04-07 06:56:38 UTC (rev 42622)
@@ -390,7 +390,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/mcs/typemanager.cs
===================================================================
--- trunk/mcs/mcs/typemanager.cs        2005-04-07 05:45:31 UTC (rev 42621)
+++ trunk/mcs/mcs/typemanager.cs        2005-04-07 06:56:38 UTC (rev 42622)
@@ -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
@@ -1080,6 +1081,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");
 
                //
                // .NET 2.0

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to