X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fspecialise%2FSpecConstr.lhs;h=7541a9314faa9a877ff908e1fa953d216f20ad67;hb=48967672a6e999cda74a5a7e02059930ef794961;hp=74944da983bd1021eaee75e78bb68dfc84983f39;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs index 74944da..7541a93 100644 --- a/compiler/specialise/SpecConstr.lhs +++ b/compiler/specialise/SpecConstr.lhs @@ -262,6 +262,9 @@ extendCaseBndrs env case_bndr scrut con@(DataAlt data_con) alt_bndrs map varToCoreExpr alt_bndrs gadt_args = map (substExpr subst . varToCoreExpr) alt_bndrs + -- This call generates some bogus warnings from substExpr, + -- because it's inconvenient to put all the Ids in scope + -- Will be fixed when we move to FC (alt_tvs, _) = span isTyVar alt_bndrs Just (tv_subst, is_local) = coreRefineTys data_con alt_tvs (idType case_bndr) @@ -463,7 +466,7 @@ specialise env fn bndrs body (SCU {calls=calls, occs=occs}) good_calls = [ pats | (con_env, call_args) <- all_calls, call_args `lengthAtLeast` n_bndrs, -- App is saturated - let call = (bndrs `zip` call_args), + let call = bndrs `zip` call_args, any (good_arg con_env occs) call, -- At least one arg is a constr app let (_, pats) = argsToPats con_env us call_args ]