diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-01-15 13:51:55 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-01-15 13:53:46 -0500 |
commit | f380115cd834ffbe51aca60f5476a51b94cdd413 (patch) | |
tree | 97ce4906b20c00a369e763954c75d3f6f02c2d9f /compiler | |
parent | 41afbb3f20f3d84abacb37afcc5aa64b24c22da8 (diff) | |
download | haskell-f380115cd834ffbe51aca60f5476a51b94cdd413.tar.gz |
Parenthesize forall-type args in cvtTypeKind
Trac #14646 happened because we forgot to parenthesize `forall` types to
the left of an arrow. This simple patch fixes that.
Test Plan: make test TEST=T14646
Reviewers: alanz, goldfire, bgamari
Reviewed By: alanz
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14646
Differential Revision: https://phabricator.haskell.org/D4298
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/hsSyn/Convert.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index de72878cda..e8c7f0de01 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1219,10 +1219,11 @@ cvtTypeKind ty_str ty tys' ArrowT | [x',y'] <- tys' -> do - case x' of - (L _ HsFunTy{}) -> do { x'' <- returnL (HsParTy x') - ; returnL (HsFunTy x'' y') } - _ -> returnL (HsFunTy x' y') + x'' <- case x' of + L _ HsFunTy{} -> returnL (HsParTy x') + L _ HsForAllTy{} -> returnL (HsParTy x') -- #14646 + _ -> return x' + returnL (HsFunTy x'' y') | otherwise -> mk_apps (HsTyVar NotPromoted (noLoc (getRdrName funTyCon))) tys' |