[m-dev.] Odd error from the compiler

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jun 16 12:02:25 AEST 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.

> At the very least, this is an unhelpful error message (I don't know how
> to fix the problem).  At worst it's a bug.  Can anybody say anything one
> way or the other?

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.

> [Time passes... DMO pointed out that the code that caused the above error
> violated the monomorphism restriction for higher order code.  I've fixed
> that problem, but my point about the error message remains the same.
> Unfortunately, I haven't preserved the erroneous code, but could
> probably reproduce it if necessary.]

What would you suggest as a better error message?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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