summaryrefslogtreecommitdiff
path: root/compiler/hsSyn/Convert.hs
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2018-07-05 08:51:43 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2018-07-05 09:51:15 -0400
commitb6a3386186b77333b7a6cdc163499d7dae0dad1c (patch)
treec4ba13c33ddfe8b4a0a12ffcda4df77db2ce816a /compiler/hsSyn/Convert.hs
parent57733978482dc1e566a7d4cd90d4cbbd1315e3b2 (diff)
downloadhaskell-b6a3386186b77333b7a6cdc163499d7dae0dad1c.tar.gz
Fix #15331 with careful blasts of parenthesizeHsType
Summary: Another `-ddump-splices` bug that can be solved with more judicious use of parentheses. Test Plan: make test TEST=T15331 Reviewers: goldfire, bgamari, alanz, tdammers Reviewed By: tdammers Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15331 Differential Revision: https://phabricator.haskell.org/D4920
Diffstat (limited to 'compiler/hsSyn/Convert.hs')
-rw-r--r--compiler/hsSyn/Convert.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs
index aa651da8e3..c64cb7c662 100644
--- a/compiler/hsSyn/Convert.hs
+++ b/compiler/hsSyn/Convert.hs
@@ -818,7 +818,8 @@ cvtl e = wrapL (cvt e)
cvt (AppTypeE e t) = do { e' <- cvtl e
; t' <- cvtType t
; tp <- wrap_apps t'
- ; return $ HsAppType (mkHsWildCardBndrs tp) e' }
+ ; let tp' = parenthesizeHsType appPrec tp
+ ; return $ HsAppType (mkHsWildCardBndrs tp') e' }
cvt (LamE [] e) = cvt e -- Degenerate case. We convert the body as its
-- own expression to avoid pretty-printing
-- oddities that can result from zero-argument