void ImportTypeParameterTypeConstraints (TypeParameterSpec spec, MetaType type)
{
var constraints = type.GetGenericParameterConstraints ();
List<TypeSpec> tparams = null;
foreach (var ct in constraints) {
if (ct.IsGenericParameter) {
if (tparams == null)
tparams = new List<TypeSpec> ();
tparams.Add (CreateType (ct));
continue;
}
if (!IsMissingType (ct) && ct.IsClass) {
spec.BaseType = CreateType (ct);
continue;
}
spec.AddInterface (CreateType (ct));
}
if (spec.BaseType == null)
spec.BaseType = module.Compiler.BuiltinTypes.Object;
if (tparams != null)
spec.TypeArguments = tparams.ToArray ();
}