Fix a small performance bug. In mkAlts, when calculating the
impossible constructors, we were looking at the unfolding for the case
binder instead of the scrutinee, with the result that we sometimes
didn't notice that a DEFAULT case could be resolved into a specific
pattern.
in
returnSmpl better_alts
where
- impossible_cons = otherCons (idUnfolding case_bndr)
+ impossible_cons = case scrut of
+ Var v -> otherCons (idUnfolding v)
+ other -> []
handled_data_cons = [data_con | DataAlt data_con <- impossible_cons] ++
[data_con | (DataAlt data_con, _, _) <- alts]
is_missing con = not (con `elem` handled_data_cons)