Fix Trac #2136: reporting of unused variables
[ghc-hetmet.git] / compiler / rename / RnPat.lhs
index 2edb72d..0c0d683 100644 (file)
@@ -105,9 +105,10 @@ matchNameMaker :: NameMaker
 matchNameMaker
   = NM (\ rdr_name thing_inside -> 
        do { names@[name] <- newLocalsRn [rdr_name]
-          ; bindLocalNamesFV names $
-            warnUnusedMatches names $
-            thing_inside name })
+          ; bindLocalNamesFV names $ do
+          { (res, fvs) <- thing_inside name
+          ; warnUnusedMatches names fvs
+          ; return (res, fvs) }})
                          
 topRecNameMaker, localRecNameMaker
   :: UniqFM (Located Fixity) -- mini fixity env for the names we're about to bind