}
}
+ public Constraints Clone ()
+ {
+ return new Constraints (name, constraints, loc);
+ }
+
GenericParameterAttributes attrs;
TypeExpr class_constraint;
ArrayList iface_constraints;
TypeManager.CSharpName (mparam), TypeManager.CSharpSignature (mb));
return false;
}
- } else if (DeclSpace is Iterator) {
+ } else if (DeclSpace is CompilerGeneratedClass) {
TypeParameter[] tparams = DeclSpace.TypeParameters;
Type[] types = new Type [tparams.Length];
for (int i = 0; i < tparams.Length; i++)
if (te is TypeParameterExpr)
has_type_args = true;
+#if !MS_COMPATIBLE
if (te.Type.IsSealed && te.Type.IsAbstract) {
Report.Error (718, Location, "`{0}': static classes cannot be used as generic arguments",
te.GetSignatureForError ());
return false;
}
+#endif
if (te.Type.IsPointer) {
Report.Error (306, Location, "The type `{0}' may not be used " +
"as a type argument", TypeManager.CSharpName (te.Type));
public override bool AsAccessible (DeclSpace ds, int flags)
{
+ foreach (Type t in atypes) {
+ if (!ds.AsAccessible (t, flags))
+ return false;
+ }
+
return ds.AsAccessible (gt, flags);
}
if (agc != null) {
if (agc is Constraints)
((Constraints) agc).Resolve (ec);
- is_class = agc.HasReferenceTypeConstraint;
- is_struct = agc.HasValueTypeConstraint;
+ is_class = agc.IsReferenceType;
+ is_struct = agc.IsValueType;
} else {
is_class = is_struct = false;
}
Argument a = (Argument) arguments [i];
if ((a.Expr is NullLiteral) || (a.Expr is MethodGroupExpr) ||
- (a.Expr is AnonymousMethod))
+ (a.Expr is AnonymousMethodExpression))
continue;
arg_types [i] = a.Type;
return this;
}
- if (unwrap != null) {
- expr = Convert.ImplicitConversion (ec, unwrap, rtype, loc);
- if (expr != null) {
- left = expr;
- expr = right;
- type = expr.Type;
- return this;
- }
+ Expression left_null = unwrap != null ? unwrap : left;
+ expr = Convert.ImplicitConversion (ec, left_null, rtype, loc);
+ if (expr != null) {
+ left = expr;
+ expr = right;
+ type = rtype;
+ return this;
}
Binary.Error_OperatorCannotBeApplied (loc, "??", ltype, rtype);