quotation characters in error messages
(wasn't there a ticket for this already?)
Currently identifiers etc. are quoted like this, with the "grave accent" and symmetric single-quote characters:
Ambiguous type variable `m' in the constraint:
`Monad m' arising from a use of `>>=' at gw.hs:6:47-71
This is not only an incorrect use of the "grave accent", but can be confusing when an identifier-name contains the prime symbol which is the same as the character used here to end the quote.
What should we do? Well, I just noticed that gcc-4.2.3 uses the Unicode begin-single-quote and end-single-quote characters for the purpose (and it actually looks quite nice on my terminal). If GCC was willing to do it, perhaps we should be too! To be precise, it uses them in my default locale, "en_US.UTF-8", which must have been the Ubuntu default that I didn't even remember I had. With env LANG=C
, GCC emits ASCII single-quotes for both the begin and the end.
> cat errory.c
syntax error
> gcc errory.c
errory.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘error’
> env LANG=C gcc errory.c
errory.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'error'
I propose copying GCC's behavior (which might involve first looking into exactly what its behavior is in the general case).
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.3 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |