Author: martin
Date: 2005-04-22 11:04:49 -0400 (Fri, 22 Apr 2005)
New Revision: 43442

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/ecore.cs
   trunk/mcs/gmcs/generic.cs
Log:
2005-04-22  Martin Baulig  <[EMAIL PROTECTED]>

        * generic.cs
        (Constraints.Resolve): Make things work wrt. the new type lookup system.
        (ConstructedType.ResolveAsTypeTerminal): Don't override this.

        * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
        ConstructedType, check its constraints.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-22 14:58:56 UTC (rev 43441)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-22 15:04:49 UTC (rev 43442)
@@ -1,3 +1,12 @@
+2005-04-22  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * generic.cs
+       (Constraints.Resolve): Make things work wrt. the new type lookup system.
+       (ConstructedType.ResolveAsTypeTerminal): Don't override this.
+
+       * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
+       ConstructedType, check its constraints.
+
 2005-04-20  Marek Safar  <[EMAIL PROTECTED]>
 
        * codegen.cs (InRefOutArgumentResolving): New field.

Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs     2005-04-22 14:58:56 UTC (rev 43441)
+++ trunk/mcs/gmcs/ecore.cs     2005-04-22 15:04:49 UTC (rev 43442)
@@ -288,6 +288,10 @@
                                return null;
                        }
 
+                       ConstructedType ct = te as ConstructedType;
+                       if ((ct != null) && !ct.CheckConstraints (ec))
+                               return null;
+
                        return te;
                }
               

Modified: trunk/mcs/gmcs/generic.cs
===================================================================
--- trunk/mcs/gmcs/generic.cs   2005-04-22 14:58:56 UTC (rev 43441)
+++ trunk/mcs/gmcs/generic.cs   2005-04-22 15:04:49 UTC (rev 43442)
@@ -199,14 +199,19 @@
                                        continue;
                                }
 
+                               FullNamedExpression fn = ((Expression) 
obj).ResolveAsTypeStep (ec);
+                               if (fn == null)
+                                       return false;
+
                                TypeExpr expr;
-                               if (obj is ConstructedType) {
-                                       ConstructedType cexpr = 
(ConstructedType) obj;
+                               ConstructedType cexpr = fn as ConstructedType;
+                               if (cexpr != null) {
                                        if (!cexpr.ResolveConstructedType (ec))
                                                return false;
+
                                        expr = cexpr;
                                } else
-                                       expr = ((Expression) 
obj).ResolveAsTypeTerminal (ec);
+                                       expr = fn.ResolveAsTypeTerminal (ec);
 
                                if (expr == null)
                                        return false;
@@ -304,7 +309,11 @@
                                        return false;
                                }
 
-                               list.Add (iface_constraint.Type);
+                               TypeExpr te = 
iface_constraint.ResolveAsTypeTerminal (ec);
+                               if (te == null)
+                                       return false;
+
+                               list.Add (te.Type);
                        }
 
                        foreach (TypeParameterExpr expr in 
type_param_constraints) {
@@ -325,7 +334,11 @@
                        list.CopyTo (iface_constraint_types, 0);
 
                        if (class_constraint != null) {
-                               class_constraint_type = class_constraint.Type;
+                               TypeExpr te = 
class_constraint.ResolveAsTypeTerminal (ec);
+                               if (te == null)
+                                       return false;
+
+                               class_constraint_type = te.Type;
                                if (class_constraint_type == null)
                                        return false;
 
@@ -1266,17 +1279,6 @@
                        return true;
                }
 
-               public override TypeExpr ResolveAsTypeTerminal (EmitContext ec)
-               {
-                       if (base.ResolveAsTypeTerminal (ec) == null)
-                               return null;
-
-                       if (!CheckConstraints (ec))
-                               return null;
-
-                       return this;
-               }
-
                public bool ResolveConstructedType (EmitContext ec)
                {
                        if (type != null)

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

Reply via email to