@@ -70,6 +70,12 @@ p_hsType = \case
70 p_rdrName op
70 p_rdrName op
72 located y p_hsType
72 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.
73 HsParTy NoExt t ->
79 HsParTy NoExt t ->
74 parens (located t p_hsType)
80 parens (located t p_hsType)
75 HsIParamTy NoExt n t -> sitcc $ do
81 HsIParamTy NoExt n t -> sitcc $ do
@@ -79,12 +85,14 @@ p_hsType = \case
80 located t p_hsType
86 located t p_hsType
81 HsStarTy NoExt _ -> txt "*"
87 HsStarTy NoExt _ -> txt "*"
82− HsKindSig NoExt t k -> sitcc $ do
88+ HsKindSig NoExt t k ->
89+ -- NOTE Also see the comment for 'HsParTy'.
83− located t p_hsType
91+ located t p_hsType
84− space -- FIXME
92+ space -- FIXME
85− inci $ do
93+ inci $ do
86− txt ":: "
94+ txt ":: "
87− located k p_hsType
95+ located k p_hsType
88 HsSpliceTy _ _ -> error "HsSpliceTy"
96 HsSpliceTy _ _ -> error "HsSpliceTy"
89 HsDocTy NoExt _ _ -> error "HsDocTy"
97 HsDocTy NoExt _ _ -> error "HsDocTy"
90 HsBangTy NoExt (HsSrcBang _ u s) t -> do
98 HsBangTy NoExt (HsSrcBang _ u s) t -> do