From baa3f2a98d1c7ed158ca9f6011168fda7a32f64d Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 12 Dec 2000 17:19:33 +0000 Subject: [PATCH] [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. --- ghc/compiler/stgSyn/CoreToStg.lhs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 ) -- 1.7.10.4