[GHC] #15307: Incorrect -ddump-deriv parenthesization for GND'd fmap implementation
GHC
ghc-devs at haskell.org
Thu Jul 5 13:51:59 UTC 2018
#15307: Incorrect -ddump-deriv parenthesization for GND'd fmap implementation
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4890
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott <ryan.gl.scott@…>):
In [changeset:"59a15a56e180b59656e45df04f7df61de8298881/ghc" 59a15a5/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="59a15a56e180b59656e45df04f7df61de8298881"
Fix #15307 by making nlHsFunTy parenthesize more
Summary:
`nlHsFunTy` wasn't parenthesizing its arguments at all,
which led to `-ddump-deriv` producing incorrectly parenthesized
types (since it uses `nlHsFunTy` to construct those types), as
demonstrated in #15307. Fix this by changing `nlHsFunTy` to add
parentheses à la `ppr_ty`: always parenthesizing the argument type
with function precedence, and recursively processing the result type,
adding parentheses for each function type it encounters.
Test Plan: make test TEST=T14578
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15307
Differential Revision: https://phabricator.haskell.org/D4890
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15307#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list