From 6c69388d73b34f112ef68961353fc697a53799ac Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Fri, 19 Jul 2019 00:12:04 +0200 Subject: [PATCH] Make errors more descriptive This is defensive against GHC API guarantees. --- src/Language/Haskell/Brittany/Internal/Layouters/Decl.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Language/Haskell/Brittany/Internal/Layouters/Decl.hs b/src/Language/Haskell/Brittany/Internal/Layouters/Decl.hs index 9a81727..0dc05a7 100644 --- a/src/Language/Haskell/Brittany/Internal/Layouters/Decl.hs +++ b/src/Language/Haskell/Brittany/Internal/Layouters/Decl.hs @@ -236,10 +236,10 @@ layoutIPBind :: ToBriDoc IPBind layoutIPBind lipbind@(L _ bind) = case bind of #if MIN_VERSION_ghc(8,6,0) /* ghc-8.6 */ XIPBind{} -> unknownNodeError "XIPBind" lipbind - IPBind _ (Right _) _ -> error "unreachable" + IPBind _ (Right _) _ -> error "brittany internal error: IPBind Right" IPBind _ (Left (L _ (HsIPName name))) expr -> do #else - IPBind (Right _) _ -> error "unreachable" + IPBind (Right _) _ -> error "brittany internal error: IPBind Right" IPBind (Left (L _ (HsIPName name))) expr -> do #endif ipName <- docLit $ Text.pack $ '?' : FastString.unpackFS name