Commit 877d4fbd authored by simonpj's avatar simonpj
Browse files

[project @ 2003-02-21 14:52:31 by simonpj]

Fix buglets in new unused-binding story
parent 2565ba31
......@@ -197,13 +197,21 @@ rnMonoBindsAndThen mbinds sigs thing_inside -- Non-empty monobinds
-- Final error checking
all_uses = duUses bind_dus `plusFV` result_fvs
bndrs = duDefs bind_dus
all_uses = findUses bind_dus result_fvs
real_uses = findUses bind_dus result_fvs
unused_bndrs = nameSetToList (bndrs `minusNameSet` all_uses)
warnUnusedLocalBinds unused_bndrs `thenM_`
returnM (result, all_uses `minusNameSet` bndrs)
-- It's important to return all the uses, not the 'real uses' used for
-- warning about unused bindings. Otherwise consider:
-- x = 3
-- y = let p = x in 'x'
-- If we don't "see" the dependency of 'y' on 'x', we may put the
-- bindings in the wrong order, and the type checker will complain
-- that x isn't in scope
mbinders_w_srclocs = collectLocatedMonoBinders mbinds
doc = text "In the binding group for:"
......@@ -246,7 +254,6 @@ rnMonoBinds top_lvl mbinds sigs
final_binds = foldr ThenBinds EmptyBinds binds_s
binders = duDefs bind_dus
-- Check for duplicate or mis-placed signatures
checkSigs (okBindSig binders) siglist `thenM_`
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment