[nhc-bugs] Misleading error message for underscore patterns

Tony Sloane asloane at ics.mq.edu.au
Tue Jun 14 00:19:02 EDT 2005


Not really a bug, but a confusion from a misleading error message.   
This was seen using nhc98 1.18 on Mac OS X 10.4.1.

The following code contains underscore identifier patterns which are  
accepted by nhc98 when the -98 option is given:

foo _2a = 1

bar (T a _2b) = 1

(I don't have the H98 definition handy but I'm presuming that nhc is  
correct in allowing these patterns in H98.)

However, when -98 is not present, errors are reported that are  
misleading in that they refer to the "foo" and "bar" tokens, not the  
bad patterns, and they don't complain about the patterns at all:

3:1-3:3 Found foo but expected a {-end-of-definition-or-EOF-}
5:1-5:3 Found bar but expected a {-end-of-definition-or-EOF-}

As the bar example illustrates, the actual error could be arbitrarily  
far away from the position in the message.

Tony



More information about the Nhc-bugs mailing list