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
;
40 public TypeParameterExpr (string type_parameter
, Location l
)
41 : base (typeof (object), l
)
43 this.type_parameter
= type_parameter
;
46 public override string ToString ()
48 return "TypeParameter[" + type_parameter
+ "]";
51 public void Error_CannotUseAsUnmanagedType (Location loc
)
53 Report
.Error (-203, loc
, "Can not use type parameter as unamanged type");