condition tests passes
[mono.git] / mcs / mcs / generic-mcs.cs
index afaf301b294b2696bf0321164bec1a70d6e0ba76..449677a13a7d4694da09c926bbe411ac3b450d42 100644 (file)
@@ -13,6 +13,13 @@ using System.Collections;
 
 namespace Mono.CSharp
 {
+       public enum SpecialConstraint
+       {
+               Constructor,
+               ReferenceType,
+               ValueType
+       }
+       
        public abstract class GenericConstraints
        {
                public abstract string TypeParameter {
@@ -24,18 +31,28 @@ namespace Mono.CSharp
                }
        }
 
-       public abstract class Constraints : GenericConstraints
+       public class Constraints : GenericConstraints
        {
+               public Constraints (string name, ArrayList constraints, Location loc)
+               {
+               }
+               
                public Constraints Clone ()
                {
                        throw new NotImplementedException ();
                }
 
-               public abstract Location Location {
-                       get;
+               public Location Location {
+                       get { return Location.Null; } 
                }
+               
+               public override string TypeParameter {
+                       get { throw new NotImplementedException (); }
+               }               
 
-               public abstract void VerifyClsCompliance ();
+               public void VerifyClsCompliance ()
+               {
+               }
        }
 
        public class TypeParameter : MemberCore, IMemberContainer
@@ -285,24 +302,37 @@ 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)
                {
-                       throw new NotImplementedException ();
+                       args = new ArrayList ();
+                       this.Location = loc;
                }
-               
+
                public TypeArguments (Location loc, params Expression[] types)
                {
-                       throw new NotImplementedException ();
-               }               
+                       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)
                {
-                       throw new NotImplementedException ();
                }
 
                public void Add (TypeArguments new_args)
                {
-                       throw new NotImplementedException ();
                }
 
                public bool Resolve (IResolveContext ec)
@@ -315,7 +345,12 @@ namespace Mono.CSharp
                }
 
                public int Count {
-                       get { throw new NotImplementedException (); }
+                       get {
+                               if (dimension > 0)
+                                       return dimension;
+                               else
+                                       return args.Count;
+                       }
                }
 
                public bool IsUnbound {
@@ -350,4 +385,32 @@ 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 ();
+                       }
+               }
+       }
 }