[mercury-users] Sneaky pseudo-buglet with typeclasses.

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 2 15:01:34 AEDT 1999


On 01-Nov-1999, Ralph Becket <rbeck at microsoft.com> wrote:
...
> 	:- instance foo(bar) where [
>         pred (new/1) is bar_new
> 	].
...
> singlearg.m:015: Error: expected `pred(<Name> / <Arity>) is <InstanceName>':
> pred new / 1 is bar_new.
...
> The cause of this hard-to-spot error is that I've accidentally inserted a
> space between `pred' and the `(new/1)' in the instance declaration.  This
> is quite a nasty one because the norm in the rest of the language is for
> `pred' and `func' to stand as prefix operators - you have to get rid of the
> space here or the structure parses differently and the compiler gets upset.
> Beware.
> 
> To the developers: should I report this as an unclear error message?  It's
> just taken me 40mins to track down and I hate this sort of 1-char bug.

Yes, it certainly helps if things like this are reported to
mercury-bugs at cs.mu.oz.au.  It helps us to figure out where we should
concentrate our efforts.

It would also be helpful if you could suggest what kind of message
you would like to see from the compiler for this sort of thing.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list