[Mono-dev] Generic Variance

Marek Safar marek.safar at seznam.cz
Tue Feb 3 05:53:39 EST 2009


Hi Scott
> Here is a new patch.
>   

 			bool ok = parameters.Resolve (ec);
 
+			if (!parameters.VerifyNoVariantTypeParameters ())
+				ok = false;
+

This should go into parameters, you could cast IResolveContext to check 
for dummies.

+			case Token.IN:
+			case Token.OUT:
+				if (handle_where && RootContext.Version < LanguageVersion.Future) {
+					Report.FeatureIsNotAvailable (Location, "generic variance");
+					res = -1;
+				}
+				break;

Move the check to cs-parser.jay, you are also missing a test for this.

+type_parameter_variance
+	: OUT {
+		$$ = Variance.Covariant;
+	  }

Formating




Marek


More information about the Mono-devel-list mailing list