ocaml/ocaml — pull request #6 by hnrgrgr (2014-01-31 17:21:09+00:00)
Title: Warn user when a type variable in a type constraint has been instantiated.

It seems to be a common misunderstanding amongst beginners that type variables in type constraint are unification variables and that they should be explicitly quantified when desired.

This small patch adds a warning when such non-quantified variable has been instantiated by the type checker. The verification is made /a posteriori/ by looking for type constraints in the typed tree.

I'm not sure this warning is really a desired feature, but it is probably worth discussion. For instance, ocamlyacc-generated files use such variables on purpose.