2004-11-18 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Thu, 18 Nov 2004 05:18:50 +0000 (05:18 -0000)
committerMartin Baulig <martin@novell.com>
Thu, 18 Nov 2004 05:18:50 +0000 (05:18 -0000)
* decl.cs
(DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.

* delegate.cs (Delegate.DefineType): Always create the EmitContext.

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

mcs/gmcs/ChangeLog
mcs/gmcs/class.cs
mcs/gmcs/decl.cs
mcs/gmcs/delegate.cs
mcs/gmcs/ecore.cs
mcs/gmcs/expression.cs
mcs/gmcs/iterators.cs

index 6974697861f27102848401b4e2fb59e82f51399b..8f44ae7df2860d0618ce15de008f983e321b623d 100755 (executable)
@@ -1,3 +1,10 @@
+2004-11-18  Martin Baulig  <martin@ximian.com>
+
+       * decl.cs
+       (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
+
+       * delegate.cs (Delegate.DefineType): Always create the EmitContext.
+
 2004-11-18  Martin Baulig  <martin@ximian.com>
 
        * ecore.cs (TypeExpr.ResolveType): Removed.
index 5d1606ac7df079b5464f5f4a0cbabaed85db6656..070886884c462da179ded786519ad3e9d6cb799c 100755 (executable)
@@ -1331,11 +1331,13 @@ namespace Mono.CSharp {
                        }
 
                        if (current_type != null) {
-                               CurrentType = current_type.ResolveAsTypeTerminal (ec);
-                               if (CurrentType == null) {
+                               current_type = current_type.ResolveAsTypeTerminal (ec);
+                               if (current_type == null) {
                                        error = true;
                                        return null;
                                }
+
+                               CurrentType = current_type.Type;
                        }
 
                        //
@@ -1529,7 +1531,7 @@ namespace Mono.CSharp {
                        DefineContainerMembers (delegates);
 
                        if (CurrentType != null) {
-                               GenericType = CurrentType.Type;
+                               GenericType = CurrentType;
 
                                ec.ContainerType = GenericType;
                        }
@@ -4861,7 +4863,7 @@ namespace Mono.CSharp {
                                return false;
 
                        if (container.CurrentType != null)
-                               declaring_type = container.CurrentType.Type;
+                               declaring_type = container.CurrentType;
                        else
                                declaring_type = container.TypeBuilder;
 
index d75008c735059e087edfc8cc588457ede3da4805..57bf1edb8955186f9fa0663a55edc57bae9b2bd3 100755 (executable)
@@ -465,7 +465,7 @@ namespace Mono.CSharp {
                ///   currently defining.  We need to lookup members on this
                ///   instead of the TypeBuilder.
                /// </summary>
-               public TypeExpr CurrentType;
+               public Type CurrentType;
 
                //
                // This is the namespace in which this typecontainer
@@ -1373,9 +1373,9 @@ namespace Mono.CSharp {
                                throw new InvalidOperationException ();
 
                        if (CurrentType != null)
-                               return CurrentType;
-
-                       return new TypeExpression (TypeBuilder, Location);
+                               return new TypeExpression (CurrentType, Location);
+                       else
+                               return new TypeExpression (TypeBuilder, Location);
                }
 
                public override string[] ValidAttributeTargets {
index b52073da0ce72f35d7b856b2b11a57b700a2cdb1..36a5b481e5fb4b4edd9ef0d95c9ba55beb0ec26d 100644 (file)
@@ -79,6 +79,8 @@ namespace Mono.CSharp {
                        if (TypeBuilder != null)
                                return TypeBuilder;
 
+                       ec = new EmitContext (this, this, Location, null, null, ModFlags, false);
+
                        if (IsGeneric) {
                                foreach (TypeParameter type_param in TypeParameters)
                                        if (!type_param.Resolve (this))
@@ -107,12 +109,6 @@ namespace Mono.CSharp {
                        TypeManager.AddDelegateType (Name, TypeBuilder, this);
 
                        if (IsGeneric) {
-                               CurrentType = new ConstructedType (
-                                       Name, TypeParameters, Location);
-
-                               EmitContext ec = new EmitContext (
-                                       this, this, Location, null, null, ModFlags, false);
-
                                string[] param_names = new string [TypeParameters.Length];
                                for (int i = 0; i < TypeParameters.Length; i++)
                                        param_names [i] = TypeParameters [i].Name;
@@ -128,6 +124,13 @@ namespace Mono.CSharp {
                                        if (!type_param.DefineType (ec))
                                                return null;
                                }
+
+                               TypeExpr current = new ConstructedType (Name, TypeParameters, Location);
+                               current = current.ResolveAsTypeTerminal (ec);
+                               if (current == null)
+                                       return null;
+
+                               CurrentType = current.Type;
                        }
 
                        return TypeBuilder;
index 32c54bdc378482cd58c10ad27c92800d4aa6a34d..65ff6a732a60174cea055c0c5e6fd3d7881d80c0 100755 (executable)
@@ -2986,7 +2986,7 @@ namespace Mono.CSharp {
                                Type ctype;
                                if (!is_field_initializer &&
                                    (ec.TypeContainer.CurrentType != null))
-                                       ctype = ec.TypeContainer.CurrentType.Type;
+                                       ctype = ec.TypeContainer.CurrentType;
                                else
                                        ctype = ec.ContainerType;
 
index 7aa3237924bd07d6383fae79f31987b58f5381a0..8b712d01bd7c11f24099cf99bad46812d8195dca 100755 (executable)
@@ -7040,7 +7040,7 @@ namespace Mono.CSharp {
                        eclass = ExprClass.Variable;
 
                        if (ec.TypeContainer.CurrentType != null)
-                               type = ec.TypeContainer.CurrentType.Type;
+                               type = ec.TypeContainer.CurrentType;
                        else
                                type = ec.ContainerType;
 
index b05639d8b7c802cc78cd45543e0d79376b64e3b3..2a79614f7b24f9cd6c81ee0912ae32a990128a48 100644 (file)
@@ -399,7 +399,7 @@ namespace Mono.CSharp {
                        }
 
                        if (container.CurrentType != null)
-                               this_type = container.CurrentType.Type;
+                               this_type = container.CurrentType;
                        else
                                this_type = container.TypeBuilder;
 
@@ -443,7 +443,7 @@ namespace Mono.CSharp {
                protected override bool DefineNestedTypes ()
                {
                        if (CurrentType != null)
-                               current_type = CurrentType;
+                               current_type = new TypeExpression (CurrentType, Location);
                        else
                                current_type = new TypeExpression (TypeBuilder, Location);