From 620410fed8ee6169ccdfd5d7f914433319b29ae8 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Wed, 20 Apr 2011 17:15:38 +0100 Subject: [PATCH] Fix Trac #5126: generate correct usage info in TH declaration quotes In RnBinds.rnValBindsRHS I had (sig_dus `plusDU` bind_dus) when it should be (bind_dus `plusDU` sig_dus) So the fix is easy. --- compiler/rename/RnBinds.lhs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rename/RnBinds.lhs b/compiler/rename/RnBinds.lhs index 21822a8..df3b12d 100644 --- a/compiler/rename/RnBinds.lhs +++ b/compiler/rename/RnBinds.lhs @@ -306,7 +306,10 @@ rnValBindsRHS trim mb_bound_names (ValBindsIn mbinds sigs) (anal_binds, anal_dus) -> return (valbind', valbind'_dus) where valbind' = ValBindsOut anal_binds sigs' - valbind'_dus = usesOnly (hsSigsFVs sigs') `plusDU` anal_dus + valbind'_dus = anal_dus `plusDU` usesOnly (hsSigsFVs sigs') + -- Put the sig uses *after* the bindings + -- so that the binders are removed from + -- the uses in the sigs } rnValBindsRHS _ _ b = pprPanic "rnValBindsRHS" (ppr b) -- 1.7.10.4