[nhc-bugs] the format of error diagnostics

Feliks Kluzniak feliks@crt.se
Mon, 10 Dec 2001 16:08:05 +0100


> But what should the following kind of report translate to?
> 
>       Error when renaming::
>    Constructor OK used at 117:30, 103:15, 98:21, 72:13, 35:5 is not defined.
>    Identifier splitWhile used at 110:13, 106:8, 102:8, 91:13 is not defined.
>    Identifier digit used at 272:52, 259:52 is not defined.
> 
> Do you want a separate line for each?  

IMHO something like the following would be close to perfect:

     Error when renaming::
     file.hs:35:5: Constructor OK is not defined (4 other uses)
     file.hs:91:13: Identifier splitWhile is not defined (3 other uses)
     file.hs:259:52: Identifier digit is not defined (1 other use)

     etc.

This allows one to automatically get to the _first_ occurrence. Once the
editor's cursor is there, the locations of the rest can be discovered by
searching, if one really wants to see them (one often doesn't).  With a really
fast compiler one often saves time by making one fix and trying again, rather
than by deciphering and using information from very involved diagnostics.


> And how about this one:
> 
>       Error after type deriving/checking:
>    Type error type clash between Prelude.Int and Main.Foo
>    when trying to apply function at 4:17 to its 1:st argument at 4:8.


How about:

     file1.hs:4:8:  Error after type deriving/checking:
                    Type error type clash between Prelude.Int and Main.Foo
                    when trying to apply function to its 1:st argument
     file2.hs:4:17: (the function is defined here).

This would allow one to make Emacs put the cursor first in the offending place,
and then - if one wishes - at the definition.

Regards,
-- Feliks