Skip to content
Snippets Groups Projects
Commit ae085a75 authored by Ryan Scott's avatar Ryan Scott
Browse files

Adapt inspection-testing to Tickish-related changes

parent 355073b8
No related branches found
No related tags found
No related merge requests found
diff --git a/src/Test/Inspection/Core.hs b/src/Test/Inspection/Core.hs
index 7816010..265d3ba 100644
index 7816010..45ec4b6 100644
--- a/src/Test/Inspection/Core.hs
+++ b/src/Test/Inspection/Core.hs
@@ -83,7 +83,12 @@ slice binds v
@@ -44,6 +44,10 @@ import DataCon
import TyCon (TyCon, isClassTyCon)
#endif
+#if MIN_VERSION_ghc(9,1,0)
+import GHC.Types.Tickish (CoreTickish, GenTickish(..))
+#endif
+
import qualified Data.Set as S
import Control.Monad.State.Strict
import Control.Monad.Trans.Maybe
@@ -83,7 +87,12 @@ slice binds v
go (Type _) = pure ()
go (Coercion _) = pure ()
......@@ -16,7 +27,7 @@ index 7816010..265d3ba 100644
-- | Pretty-print a slice
pprSlice :: Slice -> SDoc
@@ -211,7 +216,11 @@ eqSlice it slice1 slice2
@@ -211,14 +220,22 @@ eqSlice it slice1 slice2
go _ _ _ = guard False
-----------
......@@ -27,8 +38,21 @@ index 7816010..265d3ba 100644
+#endif
= guard (c1 == c2) >> go (rnBndrs2 env bs1 bs2) e1 e2
go_tick :: RnEnv2 -> Tickish Id -> Tickish Id -> Bool
@@ -250,7 +259,12 @@ allTyCons ignore slice =
- go_tick :: RnEnv2 -> Tickish Id -> Tickish Id -> Bool
- go_tick env (Breakpoint lid lids) (Breakpoint rid rids)
+ go_tick :: RnEnv2 -> CoreTickish -> CoreTickish -> Bool
+ go_tick env (Breakpoint{breakpointId = lid, breakpointFVs = lids})
+ (Breakpoint{breakpointId = rid, breakpointFVs = rids})
= lid == rid && map (rnOccL env) lids == map (rnOccR env) rids
go_tick _ l r = l == r
+#if !MIN_VERSION_GLASGOW_HASKELL(9,1,0,0)
+type CoreTickish = Tickish Id
+#endif
-- | Returns @True@ if the given core expression mentions no type constructor
@@ -250,7 +267,12 @@ allTyCons ignore slice =
goB (b, e) = goV b ++ go e
......@@ -42,7 +66,7 @@ index 7816010..265d3ba 100644
goT (TyVarTy _) = []
goT (AppTy t1 t2) = goT t1 ++ goT t2
@@ -296,7 +310,12 @@ freeOfTerm slice needles = listToMaybe [ (v,e) | (v,e) <- slice, not (go e) ]
@@ -296,7 +318,12 @@ freeOfTerm slice needles = listToMaybe [ (v,e) | (v,e) <- slice, not (go e) ]
goB (_, e) = go e
......@@ -56,7 +80,7 @@ index 7816010..265d3ba 100644
goAltCon (DataAlt dc) | isNeedle (dataConName dc) = False
goAltCon _ = True
@@ -343,7 +362,12 @@ doesNotAllocate slice = listToMaybe [ (v,e) | (v,e) <- slice, not (go (idArity v
@@ -343,7 +370,12 @@ doesNotAllocate slice = listToMaybe [ (v,e) | (v,e) <- slice, not (go (idArity v
-- A let binding allocates if any variable is not a join point and not
-- unlifted
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment