summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Coercion/Opt.hs
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2020-08-10 17:58:17 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-13 03:44:52 -0400
commit55dec4dc6e8f8430810d212c73e78ffbb92e0a48 (patch)
tree2880ec2360764311c30afdba74ace624ef642cb1 /compiler/GHC/Core/Coercion/Opt.hs
parent7831fe05021caa90d4696ca91ae2b31a82e65b3d (diff)
downloadhaskell-55dec4dc6e8f8430810d212c73e78ffbb92e0a48.tar.gz
PmCheck: Better long-distance info for where bindings (#18533)
Where bindings can see evidence from the pattern match of the `GRHSs` they belong to, but not from anything in any of the guards (which belong to one of possibly many RHSs). Before this patch, we did *not* consider said evidence, causing #18533, where the lack of considering type information from a case pattern match leads to failure to resolve the vanilla COMPLETE set of a data type. Making available that information required a medium amount of refactoring so that `checkMatches` can return a `[(Deltas, NonEmpty Deltas)]`; one `(Deltas, NonEmpty Deltas)` for each `GRHSs` of the match group. The first component of the pair is the covered set of the pattern, the second component is one covered set per RHS. Fixes #18533. Regression test case: T18533
Diffstat (limited to 'compiler/GHC/Core/Coercion/Opt.hs')
-rw-r--r--compiler/GHC/Core/Coercion/Opt.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Core/Coercion/Opt.hs b/compiler/GHC/Core/Coercion/Opt.hs
index 2de2089904..fb2bde23d1 100644
--- a/compiler/GHC/Core/Coercion/Opt.hs
+++ b/compiler/GHC/Core/Coercion/Opt.hs
@@ -559,7 +559,10 @@ opt_univ env sym prov role oty1 oty2
where
prov' = case prov of
+#if __GLASGOW_HASKELL__ <= 810
+-- This alt is redundant with the first match of the FunDef
PhantomProv kco -> PhantomProv $ opt_co4_wrap env sym False Nominal kco
+#endif
ProofIrrelProv kco -> ProofIrrelProv $ opt_co4_wrap env sym False Nominal kco
PluginProv _ -> prov