[m-dev.] bad error message

Peter Schachte schachte at cs.mu.OZ.AU
Wed Aug 3 17:08:16 AEST 2005

Probably a known flaw, but you guys asked for complaints about
bad compiler error messages....

I got this error message:

    Error: expected type in instance declaration to be a functor with
    variables as args: _1.

from this declaration:

    :- instance ground_watchable(dvar(T),T).

Firstly, note there is no line number in this error message, so the
only way I know that's the code that caused the error is that I've
only got 2 instance declarations, and I get 2 identical error
messages.  If I had more, it'd be difficult to find the problem.
Secondly, I infer that the _1 means the first argument is the one with
the error, but that one *is* a functor with variables as arguments.
Thirdly, the message doesn't make it clear you can never have type
variables in instance declarations, just that it didn't expect it in
that context.

Peter Schachte              Computers are useless. They can only give you
schachte at cs.mu.OZ.AU        answers.
www.cs.mu.oz.au/~schachte/      -- Pablo Picasso 
Phone: +61 3 8344 1338      
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