From 383b82f79dca6294545315c8daf0357bc4d6f97c Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 8 Jun 2022 18:52:13 +1000 Subject: fixing HsPragE hole in typecheckedsource --- src/HaskellCodeExplorer/AST/TypecheckedSource.hs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/HaskellCodeExplorer/AST/TypecheckedSource.hs b/src/HaskellCodeExplorer/AST/TypecheckedSource.hs index d7cabd7..0aa4191 100644 --- a/src/HaskellCodeExplorer/AST/TypecheckedSource.hs +++ b/src/HaskellCodeExplorer/AST/TypecheckedSource.hs @@ -63,6 +63,7 @@ import GHC.Hs , HsExpr(..) , HsLocalBindsLR(..) , HsOverLit(..) + , HsPragE(..) , HsRecField'(..) , HsRecFields(..) , HsTupArg(..) @@ -604,7 +605,6 @@ foldTypecheckedSource = foldLHsBindsLR -- Patterns of type ‘LHsExpr GhcTc’ not matched: -- L (GHC.Parser.Annotation.SrcSpanAnn _ _) (HsGetField _ _ _) -- L (GHC.Parser.Annotation.SrcSpanAnn _ _) (HsProjection _ _) --- L (GHC.Parser.Annotation.SrcSpanAnn _ _) (HsPragE _ _ _) foldLHsExpr :: LHsExpr GhcTc -> State ASTState (Maybe Type) foldLHsExpr (L _span (XExpr _)) = return Nothing foldLHsExpr lhe@(L _ (HsVar _ (L _ identifier))) = @@ -802,14 +802,10 @@ foldLHsExpr lhe@(L _ e@(ArithSeq postTcExpr _mbSyntaxExpr seqInfo)) = do foldLHsExpr expr1 >> foldLHsExpr expr2 >> foldLHsExpr expr3 addExprInfo (getLocA lhe) typ "ArithSeq" (exprSort e) return typ --- #if MIN_VERSION_GLASGOW_HASKELL(8,6,1,0) --- foldLHsExpr lhe@(L _ e@(HsSCC _ _sourceText _fastString expr)) = do --- #else --- foldLHsExpr lhe@(L _ e@(HsSCC _sourceText _fastString expr)) = do --- #endif --- typ <- foldLHsExpr expr --- addExprInfo (getLocA lhe) typ "HsSCC" (exprSort e) --- return typ +foldLHsExpr lhe@(L _ e@(HsPragE _ (HsPragSCC {}) expr)) = do + typ <- foldLHsExpr expr + addExprInfo (getLocA lhe) typ "HsSCC" (exprSort e) + return typ -- #if MIN_VERSION_GLASGOW_HASKELL(8,6,1,0) -- foldLHsExpr lhe@(L _ e@(HsCoreAnn _ _sourceText _fastString expr)) = do -- #else -- cgit v1.2.3