There's the question of what the compiler _does_, what the compiler
_could_ do and what the compiler _should_ do.
The latter is mainly a matter of taste :)
I don't think "this 'a could be unit" is a good reason for skipping
the warning. On the contrary, "this 'a will probably sometimes be a
real value" seems a sufficient reason to add a warning. If needed, the
programmer can easily suppress the warning by adding "ignore" or
adding a ": unit" type constraint (whichever applies).
I believe that compiler for statically-typed languages has to take
all the responsibility on type information it delivers to user. So when
it says "this
expression has type X, but here is used as type unit" it must not mean
"well, sometimes it hasn't" :)
(Remains to see whether adding the warning to OCaml is worth the
manwork.)
IMHO it definitely doesn't deserve such a long discussion :))))
BR,
Dmitri.
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs