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

Update inspection-testing patch to accommodate isUnsafeEqualityProof's removal

`isUnsafeEqualityProof` was removed in favor of `isUnsafeEqualityCase` in
ghc@59202c80.
parent 53bb8a21
No related branches found
No related tags found
1 merge request!319Add ghc-lib-parser patch
Pipeline #82907 passed with warnings
diff --git a/src/Test/Inspection/Core.hs b/src/Test/Inspection/Core.hs
index f9b28a4..7fc898c 100644
--- a/src/Test/Inspection/Core.hs
+++ b/src/Test/Inspection/Core.hs
@@ -263,7 +263,9 @@ eqSlice eqv slice1 slice2
essentiallyVar (App e a) | it, isTyCoArg a = essentiallyVar e
essentiallyVar (Lam v e) | it, isTyCoVar v = essentiallyVar e
essentiallyVar (Cast e _) | it = essentiallyVar e
-#if MIN_VERSION_ghc(9,0,0)
+#if MIN_VERSION_ghc(9,9,0)
+ essentiallyVar (Case s b _ alts) | it, Just e <- isUnsafeEqualityCase s b alts = essentiallyVar e
+#elif MIN_VERSION_ghc(9,0,0)
essentiallyVar (Case s _ _ [Alt _ _ e]) | it, isUnsafeEqualityProof s = essentiallyVar e
#endif
essentiallyVar (Var v) = Just v
@@ -291,7 +293,10 @@ eqSlice eqv slice1 slice2
go lv env (Cast e1 _) e2 | it = go lv env e1 e2
go lv env e1 (Cast e2 _) | it = go lv env e1 e2
-#if MIN_VERSION_ghc(9,0,0)
+#if MIN_VERSION_ghc(9,9,0)
+ go lv env (Case s b _ alts) e2 | it, Just e1 <- isUnsafeEqualityCase s b alts = go lv env e1 e2
+ go lv env e1 (Case s b _ alts) | it, Just e2 <- isUnsafeEqualityCase s b alts = go lv env e1 e2
+#elif MIN_VERSION_ghc(9,0,0)
go lv env (Case s _ _ [Alt _ _ e1]) e2 | it, isUnsafeEqualityProof s = go lv env e1 e2
go lv env e1 (Case s _ _ [Alt _ _ e2]) | it, isUnsafeEqualityProof s = go lv env e1 e2
#endif
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