Opened 8 years ago

Closed 8 years ago

#5657 closed bug (fixed)

section suggestion adds backticks to operators

Reported by: tinctorius Owned by: simonmar
Priority: high Milestone: 7.4.1
Component: Compiler Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case: rename/should_fail/T5657
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

(I'm reporting this bug as suggested by Andreas Hammar.)

When the compiler is presented with

[LT..GT]

the following errors are given:

<interactive>:0:2:
    Failed to load interface for `LT'
    Use -v to see a list of the files searched for.

<interactive>:0:2:
    A section must be enclosed in parentheses thus: (`LT..` GT)

The latter error incorrectly endows LT.. with backticks; this suggestion will not parse. Instead, this is expected:

<interactive>:0:2:
    A section must be enclosed in parentheses thus: (LT.. GT)

Change History (5)

comment:1 Changed 8 years ago by simonpj

difficulty: Unknown
Milestone: 7.4.1
Owner: set to simonmar
Priority: normalhigh

comment:2 Changed 8 years ago by maeder

It should be easy to change the printing of a qualified symbol within a section (namely without backticks).

A more smart fix would be to change the internal qualified symbol "LT.." into the two tokens, after a "[", because a (qualified) symbol can never follow "[" AFAICS!

(Btw I vote against http://hackage.haskell.org/trac/haskell-prime/wiki/QualifiedOperators)

comment:3 Changed 8 years ago by simonpj@…

commit c492e50bd681551e14f12d9fe7479d986b47e9dc

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Mon Dec 19 16:45:13 2011 +0000

    Tidy up pretty-printing for variables
    
    We already have a class OutputableBndr; this patch adds
    methods pprInfixOcc and pprPrefixOcc, so that we can get
    rid of the hideous hack (the old) Outputable.pprHsVar.
    
    The hack was exposed by Trac #5657, which is thereby fixed.

 compiler/basicTypes/Name.lhs    |    3 +++
 compiler/basicTypes/RdrName.lhs |    3 +++
 compiler/coreSyn/CoreSyn.lhs    |    2 ++
 compiler/coreSyn/PprCore.lhs    |    3 +++
 compiler/hsSyn/HsDecls.lhs      |    4 ++--
 compiler/hsSyn/HsExpr.lhs       |   10 +++++-----
 compiler/hsSyn/HsImpExp.lhs     |    8 ++++----
 compiler/typecheck/TcHsSyn.lhs  |    2 +-
 compiler/types/TypeRep.lhs      |    4 +++-
 compiler/utils/Outputable.lhs   |   28 ++++++----------------------
 10 files changed, 32 insertions(+), 35 deletions(-)

comment:4 Changed 8 years ago by simonpj

Status: newmerge
Test Case: rename/should_fail/T5657

Done! Thanks for pointing out the infelicity. (It required a slightly more structural clean up than I thought, but it's been a long-standing wartlet.)

Simon

comment:5 Changed 8 years ago by igloo

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.