return false;
}
-#if GMCS_SOURCE
- if (ret_type.IsGenericParameter && (ret_type.GenericParameterAttributes & GenericParameterAttributes.Contravariant) != 0) {
- Report.Error (-33, Location, "Contravariant type parameters can only be used in input positions");
- return false;
- }
-#endif
+ var tp = TypeManager.LookupTypeParameter (ret_type);
+ if (tp != null && tp.Variance == Variance.Contravariant)
+ tp.ErrorInvalidVariance (this, Variance.Covariant);
//
// We don't have to check any others because they are all