[GHC] #15527: TypeApplications error message doesn't parenthesize infix name

GHC ghc-devs at haskell.org
Thu Aug 16 11:30:01 UTC 2018


#15527: TypeApplications error message doesn't parenthesize infix name
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
                                     |  TypeApplications
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5071
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Krzysztof Gogolewski <krz.gogolewski@…>):

 In [changeset:"5238f204482ac7f05f4e2d2e92576288cc00d42d/ghc"
 5238f204/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="5238f204482ac7f05f4e2d2e92576288cc00d42d"
 Fix #15527 by pretty-printing an RdrName prefixly

 Summary:
 When `(.) @Int` is used without enabling `TypeApplications`,
 the resulting error message will pretty-print the (symbolic)
 `RdrName` `(.)`. However, it does so without parenthesizing it, which
 causes the pretty-printed expression to appear as `. at Int`. Yuck.

 Since the expression in a type application will always be prefix,
 we can fix this issue by using `pprPrefixOcc` instead of plain ol'
 `ppr`.

 Test Plan: make test TEST=T15527

 Reviewers: bgamari, monoidal, simonpj

 Reviewed By: monoidal, simonpj

 Subscribers: rwbarton, carter

 GHC Trac Issues: #15527

 Differential Revision: https://phabricator.haskell.org/D5071
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15527#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list