Decode this bug

Stephen Weeks MLton@research.nj.nec.com
Fri, 10 Dec 1999 23:37:30 -0800 (PST)


> Hmm. I'm not introducting any local jumps, just sticking to the DirectExp
> interface and assuming it does the "right thing". Maybe it's a reuse of a
> variable some place... 

I don't know of any restrictions on the use of DirectExp that might
cause problems with handler inference.  Since it basically does a Cps
algorithm under the hood, I don't think that could be the problem.

> > inferHandlers ==> 
> > ==> 
> > Bug: fold2
> > 
> > uncaught exception Bug
> 
> This is the handler inference pass.  The type system must be able to
> assign a unique local handler stack to each local jump.

I think I misinterpreted the trace here.  inferHandlers completed
successfully.  The fold2 is probably an obscure (and that's being
generous) error message produced by the type checker indicating the
wrong number of arguments were passed to a constructor, passed to a
function, or returned by a function.  The error message comes from the 
call to foreach2 (which in turn calls fold2) from coerces in
cps/analyze.fun.