2008-06-25 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / generic-mcs.cs
index a2ed2a131a3c5dbf9afbb6d215f16cee2b905f86..941e9dfd5815527b048b15c2ca944ffebfdc36fd 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //   Raja R Harinath <rharinath@novell.com>
 //
-// (C) 2006 Novell, Inc.
+// Copyright 2006 Novell, Inc.
 //
 using System;
 using System.Reflection;
@@ -22,6 +22,12 @@ namespace Mono.CSharp
        
        public abstract class GenericConstraints
        {
+               public bool HasValueTypeConstraint {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+                       
                public abstract string TypeParameter {
                        get;
                }
@@ -41,7 +47,7 @@ namespace Mono.CSharp
                {
                        throw new NotImplementedException ();
                }
-
+               
                public Location Location {
                        get { return Location.Null; } 
                }
@@ -134,7 +140,7 @@ namespace Mono.CSharp
                // IMemberContainer
                //
 
-               Type IMemberContainer.Type {
+               public Type Type {
                        get { throw new NotImplementedException (); }
                }
 
@@ -169,14 +175,6 @@ namespace Mono.CSharp
 
        public class TypeParameterExpr : TypeExpr
        {
-               public override string Name {
-                       get { throw new NotImplementedException (); }
-               }
-
-               public override string FullName {
-                       get { throw new NotImplementedException (); }
-               }
-
                public TypeParameterExpr (TypeParameter type_parameter, Location loc)
                {
                        throw new NotImplementedException ();
@@ -186,6 +184,12 @@ namespace Mono.CSharp
                {
                        return null;
                }
+
+               public TypeParameter TypeParameter {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
        }
 
        public class TypeParameterName : SimpleName
@@ -222,14 +226,6 @@ namespace Mono.CSharp
                        throw new NotImplementedException ();
                }
 
-               public override string Name {
-                       get { throw new NotImplementedException (); }
-               }
-
-               public override string FullName {
-                       get { throw new NotImplementedException (); }
-               }
-
                protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
                {
                        throw new NotImplementedException ();
@@ -302,16 +298,29 @@ namespace Mono.CSharp
 
        public class TypeArguments
        {
+               public readonly Location Location;
+               ArrayList args;
+               //Type[] atypes;
+               int dimension;
+               //bool has_type_args;
+               //bool created;
+               
                public TypeArguments (Location loc)
                {
+                       args = new ArrayList ();
+                       this.Location = loc;
                }
-               
+
                public TypeArguments (Location loc, params Expression[] types)
                {
+                       this.Location = loc;
+                       this.args = new ArrayList (types);
                }
-
+               
                public TypeArguments (int dimension, Location loc)
                {
+                       this.dimension = dimension;
+                       this.Location = loc;
                }
 
                public void Add (Expression type)
@@ -332,7 +341,12 @@ namespace Mono.CSharp
                }
 
                public int Count {
-                       get { throw new NotImplementedException (); }
+                       get {
+                               if (dimension > 0)
+                                       return dimension;
+                               else
+                                       return args.Count;
+                       }
                }
 
                public bool IsUnbound {
@@ -367,32 +381,4 @@ namespace Mono.CSharp
                        throw new NotImplementedException ();           
                }
        }
-       
-       public class Nullable
-       {
-               public class NullCoalescingOperator : Expression
-               {
-                       public NullCoalescingOperator (Expression left, Expression right, Location loc)
-                       {
-                       }
-                       
-                       public override Expression DoResolve (EmitContext ec)
-                       {
-                               throw new NotImplementedException ();
-                       }
-                       
-                       public override void Emit (EmitContext ec)
-                       {
-                               throw new NotImplementedException ();
-                       }
-               }
-               
-               public class HasValue
-               {
-                       public static Expression Create (Expression expr, EmitContext ec)
-                       {
-                               throw new NotImplementedException ();
-                       }
-               }
-       }
 }