Author: martin
Date: 2006-11-22 14:24:34 -0500 (Wed, 22 Nov 2006)
New Revision: 68364

Modified:
   branches/martin/anonymous-methods2/mcs/anonymous.cs
   branches/martin/anonymous-methods2/mcs/class.cs
Log:


Modified: branches/martin/anonymous-methods2/mcs/anonymous.cs
===================================================================
--- branches/martin/anonymous-methods2/mcs/anonymous.cs 2006-11-22 19:21:06 UTC 
(rev 68363)
+++ branches/martin/anonymous-methods2/mcs/anonymous.cs 2006-11-22 19:24:34 UTC 
(rev 68364)
@@ -175,7 +175,8 @@
                        Report.Debug (128, "CREATE SCOPE", block, 
block.ScopeInfo, toplevel, ac);
 
                        if (ac == null)
-                               return new ScopeInfo (block, 
toplevel.RootScope.Parent);
+                               return new ScopeInfo (block, 
toplevel.RootScope.Parent,
+                                                     
toplevel.RootScope.GenericMethod);
 
                        Report.Debug (128, "CREATE SCOPE #1", ac, ac.Host, 
ac.Scope, ac.Block,
                                      ac.Container, ac.ContainerAnonymousMethod,
@@ -193,16 +194,15 @@
 
                        Report.Debug (128, "CREATE SCOPE #2", parent);
 
-                       ScopeInfo new_scope = new ScopeInfo (block, parent);
+                       ScopeInfo new_scope = new ScopeInfo (block, parent, 
null);
 
                        Report.Debug (128, "CREATE SCOPE #3", new_scope);
 
                        return new_scope;
                }
 
-               protected ScopeInfo (Block block, TypeContainer parent)
-                       : base (parent, block.Toplevel.RootScope.GenericMethod,
-                               0, block.StartLocation)
+               protected ScopeInfo (Block block, TypeContainer parent, 
GenericMethod generic)
+                       : base (parent, generic, 0, block.StartLocation)
                {
                        Parent = parent;
                        RootScope = block.Toplevel.RootScope;
@@ -280,6 +280,10 @@
                                foreach (TypeParameter t in 
ec.DeclContainer.CurrentTypeParameters)
                                        targs.Add (new TypeParameterExpr (t, 
Location));
 
+                       Report.Debug (128, "GET SCOPE TYPE", this, TypeBuilder, 
targs,
+                                     ec.DeclContainer, 
ec.DeclContainer.GetType (),
+                                     ec.DeclContainer.Parent.Name);
+
                        TypeExpr te = new ConstructedType (TypeBuilder, targs, 
Location);
                        te = te.ResolveAsTypeTerminal (ec, false);
                        if ((te == null) || (te.Type == null))
@@ -318,7 +322,8 @@
                public Variable CaptureScope (ScopeInfo child)
                {
                        CheckMembersDefined ();
-                       Report.Debug (128, "CAPTURE SCOPE", this, child, 
child.TypeBuilder);
+                       Report.Debug (128, "CAPTURE SCOPE", this, TypeBuilder, 
CurrentType,
+                                     child, child.TypeBuilder, 
child.CurrentType);
                        if (child == this)
                                throw new InternalErrorException ();
                        CapturedScope captured = new CapturedScope (this, 
child);
@@ -1324,6 +1329,8 @@
                                        throw new InternalErrorException ();
                                if (Scope.DefineType () == null)
                                        throw new InternalErrorException ();
+                               if (!Scope.ResolveType ())
+                                       throw new InternalErrorException ();
                        }
 
                        if (Scope != null)
@@ -1461,11 +1468,18 @@
                                }
                        }
 
+                       Report.Debug (128, "CREATE METHOD HOST #1", this, 
scope, scopes);
+
                        foreach (ScopeInfo si in scopes) {
+                               Report.Debug (128, "CREATE METHOD HOST #2", 
this, scope, si);
                                if (!si.Define ())
                                        throw new InternalErrorException ();
                                if (si.DefineType () == null)
                                        throw new InternalErrorException ();
+                               Report.Debug (128, "CREATE METHOD HOST #3", 
this, scope, si,
+                                             si.TypeBuilder);
+                               if (!si.ResolveCurrentType ())
+                                       throw new InternalErrorException ();
                                scope.CaptureScope (si);
                        }
 
@@ -1516,8 +1530,8 @@
                public MethodInfo GetMethodBuilder (EmitContext ec)
                {
                        MethodInfo builder = method.MethodBuilder;
-                       if ((RootScope != null) && RootScope.IsGeneric) {
-                               Type scope_type = RootScope.GetScopeType (ec);
+                       if ((Scope != null) && Scope.IsGeneric) {
+                               Type scope_type = Scope.GetScopeType (ec);
                                if (scope_type == null)
                                        throw new InternalErrorException ();
 

Modified: branches/martin/anonymous-methods2/mcs/class.cs
===================================================================
--- branches/martin/anonymous-methods2/mcs/class.cs     2006-11-22 19:21:06 UTC 
(rev 68363)
+++ branches/martin/anonymous-methods2/mcs/class.cs     2006-11-22 19:24:34 UTC 
(rev 68364)
@@ -1422,6 +1422,11 @@
                        return true;
                }
 
+               public bool ResolveCurrentType ()
+               {
+                       return DoResolveType ();
+               }
+
                protected virtual bool DoResolveType ()
                {
                        if ((base_type != null) &&
@@ -1461,6 +1466,9 @@
                                }
                        }
 
+                       Report.Debug (128, "CLASS RESOLVE TYPE", this, Name, 
TypeBuilder,
+                                     TypeParameters, Location);
+
                        current_type = new ConstructedType (TypeBuilder, 
TypeParameters, Location);
 
                        foreach (TypeParameter type_param in TypeParameters)

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

Reply via email to