aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-06-08 18:52:13 +1000
committerYuchen Pei <hi@ypei.me>2022-06-08 18:52:13 +1000
commit383b82f79dca6294545315c8daf0357bc4d6f97c (patch)
treed1b60cbc93d67e8d30301a9c1413c17f555ff09c
parent014057f68716515a50ab79ba8c17af3a4dc2bea4 (diff)
fixing HsPragE hole in typecheckedsource
-rw-r--r--src/HaskellCodeExplorer/AST/TypecheckedSource.hs14
1 files 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