[MLton] VERY bad error message

Matthew Fluet fluet at cs.cornell.edu
Thu Nov 30 14:23:41 PST 2006


> In the simple ML file
>
> 	val frogp = _address "frog": int ref;
>
> (where I mistakenly used the type int ref instead of MLton.Pointer.t),
> the compilation fails with the message:
>
> 	Type error: bad primapp
>
> followed by a dump of not quite 14,000 lines of intermediate code, which
> even includes some 0 bytes in it.

It's still a bug in trunk.  The 14,000 lines of intermediate code with 0 
bytes is the Basis Library implementation.

The problem is that elaborate-core.fun verifies that the type assigned to 
an _address expression is a type whose C representation will be a pointer, 
but not that the ML type is expanded to MLton.Pointer.t.  All the right 
information is there, we're just checking something weaker than what we 
need to be checking.  It should be very easy to fix.



More information about the MLton mailing list