[MLton] VERY bad error message

Matthew Fluet fluet at cs.cornell.edu
Thu Nov 30 20:37:34 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.

This is now fixed on the x86_64 branch (which I plan to merge Friday or 
Saturday).  On your example program, you get the following error:

Error: z.sml 1.13.
   Invalid type for _address.
     int32 ref
compilation aborted: parseAndElaborate reported errors




More information about the MLton mailing list