[MLton-user] Bug?

Stephen Weeks MLton-user@mlton.org
Tue, 20 Jun 2006 19:51:27 -0700


>  >   Function applied to incorrect argument.
>  >     expects: _ * _ * (([<non-equality>] * _ * _) -> _)
>  >     but got: _ * _ * (([<equality>] * _ * _) -> _)
...
> The reason it's not backwards is that the type variable is on the
> *left* of the ->.

Here's a one-liner that demonstrates the situation.

(fn g => g ignore) (fn a => a = a);

For this program, MLton generates the following error message.

  Function applied to incorrect argument.
    expects: [<non-equality>] -> _
    but got: [<equality>] -> _
    in: (fn (g) => (g ignore)) (fn (a) => (a = a))