2005-01-10 Marek Safar <marek.safar@seznam.cz>
authorMarek Safar <marek.safar@gmail.com>
Mon, 10 Jan 2005 08:54:42 +0000 (08:54 -0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 10 Jan 2005 08:54:42 +0000 (08:54 -0000)
Fix #71058
* attribute.cs (GetMethodObsoleteAttribute): Need to transform
accessors to its properties.

* ecore.cs (PropertyExpr): Add AccessorTable to help track back
from accessors to property.

svn path=/trunk/mcs/; revision=38598

mcs/mcs/ChangeLog
mcs/mcs/attribute.cs
mcs/mcs/ecore.cs

index 26a0df02ea3c9508f99848900f1acc0fee173ad6..a09a23fcb0618feec7cda7fd9d786a44364aaa56 100644 (file)
@@ -1,3 +1,12 @@
+2005-01-10  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #71058
+       * attribute.cs (GetMethodObsoleteAttribute): Need to transform
+       accessors to its properties.
+
+       * ecore.cs (PropertyExpr): Add AccessorTable to help track back
+       from accessors to property.
+       
 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
 
        Fix #70722
index 076b9e32cd99696445cb1f8d21f4b318e5e5b2ea..60466919534393857380928d05f6754cf0e38e3e 100644 (file)
@@ -1544,6 +1544,10 @@ namespace Mono.CSharp {
                        if (mb.DeclaringType is TypeBuilder)
                                return null;
 
+                       PropertyInfo pi = PropertyExpr.AccessorTable [mb] as PropertyInfo;
+                       if (pi != null)
+                               return GetMemberObsoleteAttribute (pi);
+
                        return GetMemberObsoleteAttribute (mb);
                }
 
index 36b6f00bc253d3e637642d1c75c603b301e0da68..f295147f65716a5849c37b0dcff3b1ff7eba9442 100644 (file)
@@ -3098,6 +3098,8 @@ namespace Mono.CSharp {
                LocalTemporary temp;
                bool prepared;
 
+               internal static PtrHashtable AccessorTable = new PtrHashtable (); 
+
                public PropertyExpr (EmitContext ec, PropertyInfo pi, Location l)
                {
                        PropertyInfo = pi;
@@ -3181,10 +3183,10 @@ namespace Mono.CSharp {
                                PropertyInfo pi = (PropertyInfo) group [0];
 
                                if (getter == null)
-                                       getter = pi.GetGetMethod (true);;
+                                       getter = pi.GetGetMethod (true);
 
                                if (setter == null)
-                                       setter = pi.GetSetMethod (true);;
+                                       setter = pi.GetSetMethod (true);
 
                                MethodInfo accessor = getter != null ? getter : setter;
 
@@ -3201,7 +3203,15 @@ namespace Mono.CSharp {
                {
                        FindAccessors (ec.ContainerType);
 
-                       is_static = getter != null ? getter.IsStatic : setter.IsStatic;
+                       if (getter != null) {
+                               AccessorTable [getter] = PropertyInfo;
+                               is_static = getter.IsStatic;
+                       }
+
+                       if (setter != null) {
+                               AccessorTable [setter] = PropertyInfo;
+                               is_static = setter.IsStatic;
+                       }
                }
 
                bool InstanceResolve (EmitContext ec, bool must_do_cs1540_check)