Author: martin
Date: 2005-04-18 00:50:44 -0400 (Mon, 18 Apr 2005)
New Revision: 43189

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/class.cs
   trunk/mcs/gmcs/ecore.cs
   trunk/mcs/gmcs/modifiers.cs
Log:
**** M erged r41979 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-18 04:50:22 UTC (rev 43188)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-18 04:50:44 UTC (rev 43189)
@@ -1,3 +1,17 @@
+2005-03-18  Marek Safar  <[EMAIL PROTECTED]>
+
+       * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
+       property accessor modifiers.
+
+       * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
+       fixed buffer attribute (CS1716).
+       (PropertyMethod.HasCustomAccessModifier): When property accessor
+       has custom modifier.
+       
+       * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
+       modifiers.
+       (PropertyExpr.DoResolveLValue): Add CS0272.
+
 2005-03-17  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        * convert.cs: When converting to a pointer, use the proper Conv.U

Modified: trunk/mcs/gmcs/class.cs
===================================================================
--- trunk/mcs/gmcs/class.cs     2005-04-18 04:50:22 UTC (rev 43188)
+++ trunk/mcs/gmcs/class.cs     2005-04-18 04:50:44 UTC (rev 43189)
@@ -5741,6 +5741,14 @@
                                        return;
                                }
                        }
+
+#if NET_2_0
+                       if (a.Type == TypeManager.fixed_buffer_attr_type) {
+                               Report.Error (1716, Location, "Do not use 
'System.Runtime.CompilerServices.FixedBuffer' attribute. Use the 'fixed' field 
modifier instead");
+                               return;
+                       }
+#endif
+
                        base.ApplyAttributeBuilder (a, cb);
                }
 
@@ -6458,6 +6466,7 @@
                                } else {
                                        CheckModifiers (container, ModFlags);
                                        ModFlags |= (method.ModFlags & 
(~Modifiers.Accessibility));
+                                       ModFlags |= Modifiers.PROPERTY_CUSTOM;
                                        flags = Modifiers.MethodAttr (ModFlags);
                                        flags |= (method.flags & 
(~MethodAttributes.MemberAccessMask));
                                }
@@ -6466,6 +6475,13 @@
 
                        }
 
+                       public bool HasCustomAccessModifier
+                       {
+                               get {
+                                       return (ModFlags & 
Modifiers.PROPERTY_CUSTOM) != 0;
+                               }
+                       }
+
                        public override Type[] ParameterTypes {
                                get {
                                        return TypeManager.NoTypes;

Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs     2005-04-18 04:50:22 UTC (rev 43188)
+++ trunk/mcs/gmcs/ecore.cs     2005-04-18 04:50:44 UTC (rev 43189)
@@ -3513,7 +3513,15 @@
 
                        bool must_do_cs1540_check;
                        if (!IsAccessorAccessible (ec.ContainerType, getter, 
out must_do_cs1540_check)) {
-                               Report.Error (122, loc, "'{0}.get' is 
inaccessible due to its protection level", PropertyInfo.Name);
+                               PropertyBase.PropertyMethod pm = 
TypeManager.GetMethod (getter) as PropertyBase.PropertyMethod;
+                               if (pm != null && pm.HasCustomAccessModifier) {
+                                       Report.SymbolRelatedToPreviousError 
(pm);
+                                       Report.Error (271, loc, "The property 
or indexer '{0}' cannot be used in this context because the get accessor is 
inaccessible",
+                                               TypeManager.CSharpSignature 
(getter));
+                               }
+                               else
+                                       Report.Error (122, loc, "'{0}' is 
inaccessible due to its protection level",
+                                               TypeManager.CSharpSignature 
(getter));
                                return null;
                        }
 
@@ -3565,7 +3573,15 @@
 
                        bool must_do_cs1540_check;
                        if (!IsAccessorAccessible (ec.ContainerType, setter, 
out must_do_cs1540_check)) {
-                               Report.Error (122, loc, "'{0}.set' is 
inaccessible due to its protection level", PropertyInfo.Name);
+                               PropertyBase.PropertyMethod pm = 
TypeManager.GetMethod (setter) as PropertyBase.PropertyMethod;
+                               if (pm != null && pm.HasCustomAccessModifier) {
+                                       Report.SymbolRelatedToPreviousError 
(pm);
+                                       Report.Error (272, loc, "The property 
or indexer '{0}' cannot be used in this context because the set accessor is 
inaccessible",
+                                               TypeManager.CSharpSignature 
(setter));
+                               }
+                               else
+                                       Report.Error (122, loc, "'{0}' is 
inaccessible due to its protection level",
+                                               TypeManager.CSharpSignature 
(setter));
                                return null;
                        }
 

Modified: trunk/mcs/gmcs/modifiers.cs
===================================================================
--- trunk/mcs/gmcs/modifiers.cs 2005-04-18 04:50:22 UTC (rev 43188)
+++ trunk/mcs/gmcs/modifiers.cs 2005-04-18 04:50:44 UTC (rev 43189)
@@ -27,6 +27,8 @@
                public const int UNSAFE    = 0x2000;
                public const int TOP       = 0x2000;
 
+               public const int PROPERTY_CUSTOM = 0x4000; // Custom property 
modifier
+
                //
                // We use this internally to flag that the method contains an 
iterator
                //

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

Reply via email to