[MLton-user] Mlton bug?

Matthew Fluet fluet at tti-c.org
Thu Mar 6 02:45:32 PST 2008


On Wed, 5 Mar 2008, Petersen, Leaf wrote:
> The error message below doesn't look like the usual MLton type errors,
> and the code generating it looks correct to me.

That is an internal compiler error, not a front-end type error.

> MLton 20070826 (built Sun Aug 26 20:32:41 2007 on WOLFPUP)
> MLton starting
>   Compile SML starting
>      pre codegen starting
>      pre codegen raised in 23.17 + 21.27 (48% GC)
>   Compile SML raised in 23.17 + 21.27 (48% GC)
> MLton raised in 23.17 + 21.27 (48% GC)
> Tree.t_0 has no tyconRep property
>
> Relatively trivial perturbations of the code allow it to compile.
> Anyone seen anything like this before?  I'm working on boiling it down
> to a small example, but haven't been able to yet.

The normal next steps would be to compile with "-verbose 2" (to find out 
which pass is raising the error) and "-type-check true" (to type check 
each intermediate IL program).

A quick glance at the compiler shows that the "tyconRep" property is 
unique to the PackedRepresentation pass.  Immediately after creating the 
tyconRep property, it runs through all the datatypes in the program and 
sets the tyconRep property for each tycon.  (Furthermore, this 
initialization never asks for the tyconRep property.)  So, it seems that 
this error could only arise if there was a tycon used in a type in the IL 
program that wasn't bound in the datatypes of the program.  You could 
check this by compiling with "-show-types true -keep ssa2" and then 
searching for Tree.t_0 in the z.ssa2 file.



More information about the MLton-user mailing list