summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2023-01-17 08:00:49 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-18 01:56:59 -0500
commit4efee43db5090aac4dde1293357bdb548ae71c24 (patch)
tree21df8bc95ce0c01dc5a6bbf384b54e4c942e4006 /compiler
parente9c0537cfbf7b47c64f592f529e402358b66ca7f (diff)
downloadhaskell-4efee43db5090aac4dde1293357bdb548ae71c24.tar.gz
Add missing parenthesizeHsType in cvtSigTypeKind
We need to ensure that the output of `cvtSigTypeKind` is parenthesized (at precedence `sigPrec`) so that any type signatures with an outermost, explicit kind signature can parse correctly. Fixes #22784.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/ThToHs.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/ThToHs.hs b/compiler/GHC/ThToHs.hs
index 5223d2f7df..4733768ad6 100644
--- a/compiler/GHC/ThToHs.hs
+++ b/compiler/GHC/ThToHs.hs
@@ -1556,7 +1556,7 @@ cvtSigType = cvtSigTypeKind TypeLevel
cvtSigTypeKind :: TypeOrKind -> TH.Type -> CvtM (LHsSigType GhcPs)
cvtSigTypeKind typeOrKind ty = do
ty' <- cvtTypeKind typeOrKind ty
- pure $ hsTypeToHsSigType ty'
+ pure $ hsTypeToHsSigType $ parenthesizeHsType sigPrec ty'
cvtTypeKind :: TypeOrKind -> TH.Type -> CvtM (LHsType GhcPs)
cvtTypeKind typeOrKind ty