Author: martin
Date: 2005-04-12 13:50:15 -0400 (Tue, 12 Apr 2005)
New Revision: 42848

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/expression.cs
Log:
**** Merged r40860-40862 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-12 17:49:06 UTC (rev 42847)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-12 17:50:15 UTC (rev 42848)
@@ -1,5 +1,14 @@
 2005-02-18  Raja R Harinath  <[EMAIL PROTECTED]>
 
+       Fix crasher in re-opened #72347.
+       * namespace.cs (Namespace.Lookup): Return null if
+       DeclSpace.DefineType returns null.
+
+       Fix #72678.
+       * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
+
+2005-02-18  Raja R Harinath  <[EMAIL PROTECTED]>
+
        Fix remainder of #63202.  Change semantics of DoResolveLValue: it
        now returns null if it cannot resolve to an lvalue.
        * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
@@ -17,7 +26,7 @@
        (Unary.DoResolveLValue): Simplify.
        (AddressOf.DoResolveLValue): New.
        (ArrayAccess.DoResolveLValue): New.
-       
+
 2005-02-16  Marek Safar  <[EMAIL PROTECTED]>
 
        * attribute.cs (Attribute.Resolve): Add arguments casting for

Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs        2005-04-12 17:49:06 UTC (rev 42847)
+++ trunk/mcs/gmcs/expression.cs        2005-04-12 17:50:15 UTC (rev 42848)
@@ -4244,6 +4244,32 @@
                        if (Expr == null)
                                return false;
 
+                       if (Expr is IMemberExpr) {
+                               IMemberExpr me = Expr as IMemberExpr;
+
+                               //
+                               // This can happen with the following code:
+                               //
+                               //   class X {}
+                               //   class Y {
+                               //     public Y (X x) {}
+                               //   }
+                               //   class Z : Y {
+                               //     X X;
+                               //     public Z () : base (X) {}
+                               //   }
+                               //
+                               // SimpleNameResolve is conservative about 
flagging the X as
+                               // an error since it has identical name and 
type.  However,
+                               // because there's no MemberAccess, that is not 
really justified.
+                               // It is still simpler to fix it here, rather 
than in SimpleNameResolve.
+                               //
+                               if (me.IsInstance && me.InstanceExpression == 
null) {
+                                       SimpleName.Error_ObjectRefRequired (ec, 
loc, me.Name);
+                                       return false;
+                               }
+                       }
+
                        if (ArgType == AType.Expression)
                                return true;
                        else {

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

Reply via email to