In ilasm/codegen:
[mcs.git] / mcs / generic.cs
blob4e66eb6cc66d66a6c1d82e53af4ba008a3d828ba
1 //
2 // generic.cs: Support classes for generics
3 //
4 // Author:
5 // Miguel de Icaza (miguel@ximian.com)
6 //
7 // (C) 2003 Ximian, Inc.
8 //
9 using System;
10 using System.Collections;
12 namespace Mono.CSharp {
15 // Tracks the constraints for a type parameter
17 class Constraints {
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.
24 //
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");