Author: martin
Date: 2005-04-20 04:53:46 -0400 (Wed, 20 Apr 2005)
New Revision: 43318

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/ecore.cs
   trunk/mcs/gmcs/expression.cs
Log:
**** Merged r43090 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-20 08:04:47 UTC (rev 43317)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-20 08:53:46 UTC (rev 43318)
@@ -1,3 +1,13 @@
+2005-04-16  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #73834.
+       * ecore.cs (PropertyExpr.resolved): New.
+       (DoResolve): Use it to handle a case of double resolution here.
+       Handle a case of identical-name-and-type-name.
+       * expression.cs (ArrayCreation.CheckIndices): Avoid double
+       resolution by storing the results of expression resolution back
+       into the "probes" array.
+
 2005-04-15  Raja R Harinath  <[EMAIL PROTECTED]>
 
        Fix cs0208-7.cs and cs0208-8.cs.

Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs     2005-04-20 08:04:47 UTC (rev 43317)
+++ trunk/mcs/gmcs/ecore.cs     2005-04-20 08:53:46 UTC (rev 43318)
@@ -3403,6 +3403,8 @@
                public bool IsBase;
                MethodInfo getter, setter;
                bool is_static;
+
+               bool resolved;
                
                LocalTemporary temp;
                bool prepared;
@@ -3555,6 +3557,11 @@
                
                override public Expression DoResolve (EmitContext ec)
                {
+                       if (resolved) {
+                               Report.Debug ("Double resolve of " + Name);
+                               return this;
+                       }
+
                        if (getter != null){
                                if (TypeManager.GetArgumentTypes 
(getter).Length != 0){
                                        Report.Error (
@@ -3574,16 +3581,19 @@
                                //
                                if (setter == null)
                                        return null;
-                               
-                               Report.Error (154, loc, 
-                                             "The property `" + 
PropertyInfo.Name +
-                                             "' can not be used in " +
-                                             "this context because it lacks a 
get accessor");
-                               return null;
+
+                               if (InstanceExpression != EmptyExpression.Null) 
{
+                                       Report.Error (154, loc, 
+                                               "The property `" + 
PropertyInfo.Name +
+                                               "' can not be used in " +
+                                               "this context because it lacks 
a get accessor");
+                                       return null;
+                               }
                        } 
 
-                       bool must_do_cs1540_check;
-                       if (!IsAccessorAccessible (ec.ContainerType, getter, 
out must_do_cs1540_check)) {
+                       bool must_do_cs1540_check = false;
+                       if (getter != null &&
+                           !IsAccessorAccessible (ec.ContainerType, getter, 
out must_do_cs1540_check)) {
                                PropertyBase.PropertyMethod pm = 
TypeManager.GetMethod (getter) as PropertyBase.PropertyMethod;
                                if (pm != null && pm.HasCustomAccessModifier) {
                                        Report.SymbolRelatedToPreviousError 
(pm);
@@ -3613,6 +3623,8 @@
                                return null;
                        }
 
+                       resolved = true;
+
                        return this;
                }
 

Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs        2005-04-20 08:04:47 UTC (rev 43317)
+++ trunk/mcs/gmcs/expression.cs        2005-04-20 08:53:46 UTC (rev 43318)
@@ -6304,9 +6304,11 @@
                        }
 
                        int child_bounds = -1;
-                       foreach (object o in probe) {
+                       for (int i = 0; i < probe.Count; ++i) {
+                               object o = probe [i];
                                if (o is ArrayList) {
-                                       int current_bounds = ((ArrayList) 
o).Count;
+                                       ArrayList sub_probe = o as ArrayList;
+                                       int current_bounds = sub_probe.Count;
                                        
                                        if (child_bounds == -1) 
                                                child_bounds = current_bounds;
@@ -6320,7 +6322,7 @@
                                                return false;
                                        }
                                        
-                                       bool ret = CheckIndices (ec, 
(ArrayList) o, idx + 1, specified_dims);
+                                       bool ret = CheckIndices (ec, sub_probe, 
idx + 1, specified_dims);
                                        if (!ret)
                                                return false;
                                } else {
@@ -6331,6 +6333,7 @@
                                        
                                        Expression tmp = (Expression) o;
                                        tmp = tmp.Resolve (ec);
+                                       probe [i] = tmp;
                                        if (tmp == null)
                                                return false;
 

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

Reply via email to