summaryrefslogtreecommitdiff
path: root/compiler/rename/RnExpr.lhs
diff options
context:
space:
mode:
authorMax Bolingbroke <batterseapower@hotmail.com>2011-04-02 16:52:33 +0100
committerMax Bolingbroke <batterseapower@hotmail.com>2011-04-02 16:52:33 +0100
commit41dc5190d5ffec988834fa055f407157c1e1022b (patch)
tree2d40a42bcf638513fc39385afbaf936700da1569 /compiler/rename/RnExpr.lhs
parent376bb624b0d66d4f2015ded40c46b3ea7a8263aa (diff)
downloadhaskell-wip/T4404.tar.gz
Ignore names introduced "implicitly" in unused-variable warnings (Fix #4404)wip/T4404
We collect variables introduced by the {...} part of a let-like record wildcard pattern and do not warn if the user then doesn't actually use them.
Diffstat (limited to 'compiler/rename/RnExpr.lhs')
-rw-r--r--compiler/rename/RnExpr.lhs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs
index 6d425d0822..9bb955131d 100644
--- a/compiler/rename/RnExpr.lhs
+++ b/compiler/rename/RnExpr.lhs
@@ -874,13 +874,15 @@ rnRecStmtsAndThen s cont
-- ...bring them and their fixities into scope
; let bound_names = collectLStmtsBinders (map fst new_lhs_and_fv)
+ -- Fake uses of variables introduced implicitly (warning suppression, see #4404)
+ implicit_uses = lStmtsImplicits (map fst new_lhs_and_fv)
; bindLocalNamesFV bound_names $
addLocalFixities fix_env bound_names $ do
-- (C) do the right-hand-sides and thing-inside
{ segs <- rn_rec_stmts bound_names new_lhs_and_fv
; (res, fvs) <- cont segs
- ; warnUnusedLocalBinds bound_names fvs
+ ; warnUnusedLocalBinds bound_names (fvs `unionNameSets` implicit_uses)
; return (res, fvs) }}
-- get all the fixity decls in any Let stmt