@@ -70,6 +70,12 @@ p_hsType = \case
7070 p_rdrName op
7171 space
7272 located y p_hsType
73+ HsParTy NoExt (L _ t@HsKindSig {}) ->
74+ -- NOTE Kind signatures already put parentheses around in all cases, so
75+ -- skip this layer of parentheses. The reason for this behavior is that
76+ -- parentheses are not always encoded with 'HsParTy', but seem to be
77+ -- always necessary when we have kind signatures in place.
78+ p_hsType t
7379 HsParTy NoExt t ->
7480 parens (located t p_hsType)
7581 HsIParamTy NoExt n t -> sitcc $ do
@@ -79,12 +85,14 @@ p_hsType = \case
7985 txt ":: "
8086 located t p_hsType
8187 HsStarTy NoExt _ -> txt "*"
82− HsKindSig NoExt t k -> sitcc $ do
83− located t p_hsType
84− space -- FIXME
85− inci $ do
86− txt ":: "
87− located k p_hsType
88+ HsKindSig NoExt t k ->
89+ -- NOTE Also see the comment for 'HsParTy'.
90+ parens . sitcc $ do
91+ located t p_hsType
92+ space -- FIXME
93+ inci $ do
94+ txt ":: "
95+ located k p_hsType
8896 HsSpliceTy _ _ -> error "HsSpliceTy"
8997 HsDocTy NoExt _ _ -> error "HsDocTy"
9098 HsBangTy NoExt (HsSrcBang _ u s) t -> do