Improve the error message for duplicate or invalid binders
in a binding group.
[Consequence: rnfail034 should not be an expected failure
any more]
MERGE WITH STABLE BRANCH
= -- Extract all the binders in this group,
-- and extend current scope, inventing new names for the new binders
-- This also checks that the names form a set
= -- Extract all the binders in this group,
-- and extend current scope, inventing new names for the new binders
-- This also checks that the names form a set
- bindLocatedLocalsRn (text "In a binding group")
- mbinders_w_srclocs $ \ new_mbinders ->
+ bindLocatedLocalsRn doc mbinders_w_srclocs $ \ new_mbinders ->
let
binder_set = mkNameSet new_mbinders
in
let
binder_set = mkNameSet new_mbinders
in
returnRn (result, delListFromNameSet all_fvs new_mbinders)
where
mbinders_w_srclocs = collectLocatedMonoBinders mbinds
returnRn (result, delListFromNameSet all_fvs new_mbinders)
where
mbinders_w_srclocs = collectLocatedMonoBinders mbinds
+ doc = text "In the binding group for" <+> pp_bndrs mbinders_w_srclocs
+ pp_bndrs [(b,_)] = quotes (ppr b)
+ pp_bndrs bs = fsep (punctuate comma [ppr b | (b,_) <- bs])