[m-dev.] Odd error from the compiler

Ralph Becket rafe at cs.mu.OZ.AU
Mon Jun 16 12:18:11 AEST 2003


Fergus Henderson, Monday, 16 June 2003:
> On 16-Jun-2003, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > demo.m:039: In clause for `main(di, uo)':
> > demo.m:039:   in argument 1 of call to predicate `packrat.init_memoes/4':
> > demo.m:039:   mode error: variable `TypeInfo_39' has instantiatedness `free',
> > demo.m:039:   expected instantiatedness for non-local variables
> > demo.m:039:   of lambda goals is `ground'.
> > For more information, try recompiling with `-E'.
> > ** Error making `demo.c'.
> > 
> > I'm a little bit suspect about error messages that mention TypeInfo
> > variables.
> 
> Error messages like the one above can occur if a lambda expression
> calls an existentially typed predicate and the type variable somehow
> escapes the lambda expression.

This was the case.

> Without actually seeing the source code that caused this error message,
> I can't be sure.  But the error message in and of itself is not a bug --
> I can certainly imagine some (not type/mode correct) Mercury
> source programs which will result in error messages like this.

I think it's a bug when the compiler reports a user error by referring
to compiler generated code, such as introduced TypeInfo variables, where
the problem becomes evident.

> What would you suggest as a better error message?

Something that told me what I'd done wrong!  I never introduced a
variable called TypeInfo_39 and I don't know why the compiler failed to
ensure it was instantiated at that point (of course, I could go wading
around the compiler internals, but I think that would be asking a bit
much of most users.)

-- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list