X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Frename%2FRnExpr.lhs;h=310d075d419e0c76697627437f8cf0b2da780977;hp=73dcfdb92facafac3fe031d40f4ed4dce606f8b3;hb=7836349556deef66f1b1d06fe8e9c7c0b841f0d0;hpb=3e09edbc9e9c2bd8b0fddc946ce28014881cbfa1 diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs index 73dcfdb..310d075 100644 --- a/compiler/rename/RnExpr.lhs +++ b/compiler/rename/RnExpr.lhs @@ -759,7 +759,9 @@ rnStmt ctxt (L loc (TransformStmt stmts _ using by)) thing_inside Just e -> do { (e', fvs) <- rnLExpr e; return (Just e', fvs) } ; (thing, fvs_thing) <- thing_inside bndrs ; let fvs = fvs_by `plusFV` fvs_thing - used_bndrs = filter (`elemNameSet` fvs_thing) bndrs + used_bndrs = filter (`elemNameSet` fvs) bndrs + -- The paper (Fig 5) has a bug here; we must treat any free varaible of + -- the "thing inside", **or of the by-expression**, as used ; return ((by', used_bndrs, thing), fvs) } ; return (([L loc (TransformStmt stmts' used_bndrs using' by')], thing),