2 // generic.cs: Support classes for generics
5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) 2003 Ximian, Inc.
10 using System.Collections;
12 namespace Mono.CSharp {
15 // Tracks the constraints for a type parameter
18 string type_parameter;
19 ArrayList constraints;
22 // type_parameter is the identifier, constraints is an arraylist of
23 // Expressions (with types) or `true' for the constructor constraint.
25 public Constraints (string type_parameter, ArrayList constraints)
27 this.type_parameter = type_parameter;
28 this.constraints = constraints;
33 // This type represents a generic type parameter reference.
35 // These expressions are born in a fully resolved state.
37 public class TypeParameterExpr : TypeExpr {
38 string type_parameter;
42 return type_parameter;
46 public TypeParameterExpr (string type_parameter, Location l)
47 : base (typeof (object), l)
49 this.type_parameter = type_parameter;
52 public override string ToString ()
54 return "TypeParameter[" + type_parameter + "]";
57 public void Error_CannotUseAsUnmanagedType (Location loc)
59 Report.Error (-203, loc, "Can not use type parameter as unamanged type");
63 public class TypeArguments {
66 public TypeArguments ()
68 args = new ArrayList ();
71 public void Add (Expression type)
77 public class ConstructedType : Expression {
78 Expression container_type;
82 public ConstructedType (Expression container_type, string name, TypeArguments args, Location l)
85 this.container_type = container_type;
90 public override Expression DoResolve (EmitContext ec)
92 throw new Exception ("IMPLEMENT ME");
95 public override void Emit (EmitContext ec)
97 throw new Exception ("IMPLEMENT ME");