Fix #14578 by checking isCompoundHsType in more places
authorRyan Scott <ryan.gl.scott@gmail.com>
Thu, 21 Dec 2017 00:25:18 +0000 (19:25 -0500)
committerBen Gamari <ben@smart-cactus.org>
Fri, 12 Jan 2018 20:19:23 +0000 (15:19 -0500)
commite32f582783086595bc3d69a35d19a59707e2831d
tree1abd6d0ceed0a87c1cea81d3abbfab9397ce2cc5
parent273131dfd83ef4f8b6722526dbc9be3215815af4
Fix #14578 by checking isCompoundHsType in more places

Summary:
The `HsType` pretty-printer does not automatically insert
parentheses where necessary for type applications, so a function
`isCompoundHsType` was created in D4056 towards this purpose.
However, it was not used in as many places as it ought to be,
resulting in #14578.

Test Plan: make test TEST=T14578

Reviewers: alanz, bgamari, simonpj

Reviewed By: alanz, simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #14578

Differential Revision: https://phabricator.haskell.org/D4266

(cherry picked from commit 1bd91a7ac60eba3b0c019e2228f4b2b07f8cd5ad)
compiler/hsSyn/HsTypes.hs
compiler/hsSyn/HsUtils.hs
testsuite/tests/deriving/should_compile/T14578.hs [new file with mode: 0644]
testsuite/tests/deriving/should_compile/T14578.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_compile/all.T