[MLton-devel] cvs commit: new front end
Matthew Fluet
fluet@cs.cornell.edu
Fri, 17 Oct 2003 12:09:48 -0400 (EDT)
> 3. Confusing type error messages.
> 4. Improvements to type error messages.
I know they are at the bottom of the list, but I find the use of "_"
(dontCare) in error messages a little confusing, especially when fixing
the immediate type error can simply require fixing another one down the
line:
[fluet@nonnel temp]$ cat z.sml
datatype t = T of int -> int
val x = T ()
val x = T ord
datatype 'a u = U of 'a -> 'a
val x = U ()
val x = U ord
[fluet@nonnel temp]$ mlton -stop tc z.sml
Error: z.sml 3.9: function applied to incorrect argument
expects: _ -> _
but got: unit
in: T ()
Error: z.sml 4.9: function applied to incorrect argument
expects: int -> _
but got: char -> _
in: T ord
Error: z.sml 9.9: function applied to incorrect argument
expects: _ -> _
but got: unit
in: U ()
Error: z.sml 10.9: function applied to incorrect argument
expects: _ -> char
but got: _ -> int
in: U ord
compilation aborted: elaborate reported errors
It's especially the fact that the expects in the first two messages is
definitely known to be int -> int; likewise, with ord, the got is
definitely char -> int. The last message is especially confusing, since
having expected _ -> char means that 'a has been pinned as a char.
-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel