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)
committerRyan Scott <ryan.gl.scott@gmail.com>
Thu, 21 Dec 2017 00:25:18 +0000 (19:25 -0500)
commit1bd91a7ac60eba3b0c019e2228f4b2b07f8cd5ad
tree9cfb3d4bc953dd5e1f7ef965fe1f396d0da55169
parent71f96bb349e1ef34f1d23fd49b0265813e90fd2c
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
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