diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2023-01-17 08:00:49 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2023-01-25 23:02:02 -0500 |
commit | 78f701e5e8f2bc457ae952c0cc85045b377ce272 (patch) | |
tree | 0ce865e0b67f0e2691bef69401797f3b11ec6c0a /compiler | |
parent | 45426a6d60a2f8416c462f10eddc7e3f2ff748ce (diff) | |
download | haskell-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.hs | 2 |
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 |