From: simonmar Date: Tue, 12 Dec 2000 17:19:33 +0000 (+0000) Subject: [project @ 2000-12-12 17:19:33 by simonmar] X-Git-Tag: Approximately_9120_patches~3110 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=baa3f2a98d1c7ed158ca9f6011168fda7a32f64d;p=ghc-hetmet.git [project @ 2000-12-12 17:19:33 by simonmar] Oops! Don't forget to remove type variables from the binders of a case alternative when converting to STG. --- diff --git a/ghc/compiler/stgSyn/CoreToStg.lhs b/ghc/compiler/stgSyn/CoreToStg.lhs index c9d9b63..da7f0cb 100644 --- a/ghc/compiler/stgSyn/CoreToStg.lhs +++ b/ghc/compiler/stgSyn/CoreToStg.lhs @@ -407,16 +407,20 @@ coreToStgExpr (Case scrut bndr alts) returnLne ((lit, rhs2), rhs_fvs, rhs_escs) vars_alg_alt (DataAlt con, binders, rhs) - = extendVarEnvLne [(b, CaseBound) | b <- binders] $ + = let + -- remove type variables + binders' = filter isId binders + in + extendVarEnvLne [(b, CaseBound) | b <- binders'] $ coreToStgExpr rhs `thenLne` \ (rhs2, rhs_fvs, rhs_escs) -> let - good_use_mask = [ b `elementOfFVInfo` rhs_fvs | b <- binders ] + good_use_mask = [ b `elementOfFVInfo` rhs_fvs | b <- binders' ] -- records whether each param is used in the RHS in returnLne ( - (con, binders, good_use_mask, rhs2), - rhs_fvs `minusFVBinders` binders, - rhs_escs `minusVarSet` mkVarSet binders + (con, binders', good_use_mask, rhs2), + rhs_fvs `minusFVBinders` binders', + rhs_escs `minusVarSet` mkVarSet binders' -- ToDo: remove the minusVarSet; -- since escs won't include any of these binders )