From 40509dc3f04ab7d3b5d08bf201031a8446c7f8dc Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Thu, 1 Sep 2016 14:37:17 +0200 Subject: [PATCH] Fix comment omission on type vars and qual type --- src/Language/Haskell/Brittany/Layouters/Type.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Language/Haskell/Brittany/Layouters/Type.hs b/src/Language/Haskell/Brittany/Layouters/Type.hs index a1d1ef7..f8dc199 100644 --- a/src/Language/Haskell/Brittany/Layouters/Type.hs +++ b/src/Language/Haskell/Brittany/Layouters/Type.hs @@ -30,7 +30,7 @@ layoutType ltype@(L _ typ) = docWrapNode ltype $ case typ of -- _ | traceShow (ExactPrint.Types.mkAnnKey ltype) False -> error "impossible" HsTyVar name -> do t <- lrdrNameToTextAnn name - docLit t + docWrapNode name $ docLit t HsForAllTy bndrs (L _ (HsQualTy (L _ cntxts@(_:_)) typ2)) -> do typeDoc <- docSharedWrapper layoutType typ2 tyVarDocs <- bndrs `forM` \case @@ -184,11 +184,11 @@ layoutType ltype@(L _ typ) = docWrapNode ltype $ case typ of ] x@(HsQualTy (L _ []) _) -> unknownNodeError "HsQualTy [] _" x - HsQualTy (L _ cntxts@(_:_)) typ1 -> do + HsQualTy lcntxts@(L _ cntxts@(_:_)) typ1 -> do typeDoc <- docSharedWrapper layoutType typ1 cntxtDocs <- cntxts `forM` docSharedWrapper layoutType let - contextDoc = case cntxtDocs of + contextDoc = docWrapNode lcntxts $ case cntxtDocs of [x] -> x _ -> docAlt [ let