GivenCheck fails in hpc way
Currently the GivenCheck
and GivenCheckSwap
tests fail in the hpc
way. GivenCheck
is supposed to verify that a simple program with unreachable code throws an unreachable code warning:
type family S x
f :: a -> S a
f = undefined
g :: S a ~ Char => a -> Char
g y | False = f y
| otherwise = 'a'
In the normal way the case
of g
produces the following pre-optimised Core (-ddump-ds-preopt
):
case GHC.Types.False of wild_00 {
False -> fail_dKd GHC.Prim.void#;
True ->
(f @a_aHn y_auo) `cast` (Sub co_aI6 :: S a_aHn[sk:1] ~R# Char)
}
}
However, in the hpc
way it produces:
case hpc<GivenCheckSwapMain,4>
case GHC.Types.False of t1_dKd {
False -> hpc<GivenCheckSwapMain,3> GHC.Types.False;
True -> hpc<GivenCheckSwapMain,2> GHC.Types.True
}
of wild_00 {
False -> fail_dKg GHC.Prim.void#;
True ->
hpc<GivenCheckSwapMain,6>
(f @a_aHn (hpc<GivenCheckSwapMain,5> y_auo))
`cast` (Sub co_aI6 :: S a_aHn[sk:1] ~R# Char)
}
This is enough to hide the fact that the case is unreachable from the pattern match checker.