2004-03-13 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ecore.cs
index 08863ab9c63234d841d601acacc48ae1530ae288..dc8c65a00502256f8cf68def1c1858897c8d963d 100755 (executable)
@@ -1891,6 +1891,7 @@ namespace Mono.CSharp {
        /// </remarks>
        public class SimpleName : Expression {
                public string Name;
+               public int NumTypeParameters;
 
                //
                // If true, then we are a simple name, not composed with a ".
@@ -1911,6 +1912,14 @@ namespace Mono.CSharp {
                        is_base = true;
                }
 
+               public SimpleName (string name, int num_type_params, Location l)
+               {
+                       Name = name;
+                       NumTypeParameters = num_type_params;
+                       loc = l;
+                       is_base = true;
+               }
+
                public static void Error_ObjectRefRequired (EmitContext ec, Location l, string name)
                {
                        if (ec.IsFieldInitializer)
@@ -1977,7 +1986,7 @@ namespace Mono.CSharp {
 
                        if (ec.ResolvingTypeTree){
                                int errors = Report.Errors;
-                               Type dt = ds.FindType (loc, Name);
+                               Type dt = ds.FindType (loc, Name, NumTypeParameters);
                                
                                if (Report.Errors != errors)
                                        return null;
@@ -1986,7 +1995,7 @@ namespace Mono.CSharp {
                                        return new TypeExpression (dt, loc);
 
                                if (alias_value != null){
-                                       if ((t = RootContext.LookupType (ds, alias_value, true, loc)) != null)
+                                       if ((t = RootContext.LookupType (ds, alias_value, true, NumTypeParameters, loc)) != null)
                                                return new TypeExpression (t, loc);
                                }
                        }
@@ -2011,7 +2020,7 @@ namespace Mono.CSharp {
                        // or a namespace.
                        //
 
-                       if ((t = RootContext.LookupType (ds, Name, true, loc)) != null)
+                       if ((t = RootContext.LookupType (ds, Name, true, NumTypeParameters, loc)) != null)
                                return new TypeExpression (t, loc);
                                
                        // No match, maybe our parent can compose us
@@ -2505,7 +2514,7 @@ namespace Mono.CSharp {
                {
                        FieldInfo = fi;
                        eclass = ExprClass.Variable;
-                       type = fi.FieldType;
+                       type = TypeManager.TypeToCoreType (fi.FieldType);
                        loc = l;
                }