summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2023-01-17 08:00:49 -0500
committerBen Gamari <ben@smart-cactus.org>2023-01-25 23:02:02 -0500
commit78f701e5e8f2bc457ae952c0cc85045b377ce272 (patch)
tree0ce865e0b67f0e2691bef69401797f3b11ec6c0a /compiler
parent45426a6d60a2f8416c462f10eddc7e3f2ff748ce (diff)
downloadhaskell-78f701e5e8f2bc457ae952c0cc85045b377ce272.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. (cherry picked from commit 4efee43db5090aac4dde1293357bdb548ae71c24)
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 bc6cbe0da1..87ce1bda5e 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