[MLton] deepFlatten exception

Jesper Louis Andersen jlouis@mongers.org
Wed, 14 Jun 2006 13:02:56 +0200


On Tue, 2006-06-13 at 11:39 -0400, Matthew Fluet wrote:

> > DeepFlatten.replaceVar x_0
> >
> > Is this a compiler bug, or something wrong with my program?
> 
> It is a compiler bug.  

When reading MLton source code, it occurred to me that usually when we
hit a variant in a case-pattern which must not occur, we call
Error.bug("<FunctorName/ModuleName>.<Functionname> <values>") to signify
which variant raised the bug.

I actually like this convention so much I am beginning to use it in my
own programs. Furthermore, the right place to add instruction for ICE's
(Internal Compiler Errors) seems to be Error.bug.