From: Ian Lynagh Date: Thu, 24 Jun 2010 11:03:51 +0000 (+0000) Subject: Don't warn about unused bindings with parents in .hs-boot files; trac #3449 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=cec00a4113d5b3079308b11f5e257c25908f9b37 Don't warn about unused bindings with parents in .hs-boot files; trac #3449 --- diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs index c2b7a7b..ad7709a 100644 --- a/compiler/rename/RnEnv.lhs +++ b/compiler/rename/RnEnv.lhs @@ -1043,7 +1043,18 @@ warnUnusedModules mods warnUnusedImports, warnUnusedTopBinds :: [GlobalRdrElt] -> RnM () warnUnusedImports gres = ifOptM Opt_WarnUnusedImports (warnUnusedGREs gres) -warnUnusedTopBinds gres = ifOptM Opt_WarnUnusedBinds (warnUnusedGREs gres) +warnUnusedTopBinds gres + = ifOptM Opt_WarnUnusedBinds + $ do isBoot <- tcIsHsBoot + let noParent gre = case gre_par gre of + NoParent -> True + ParentIs _ -> False + -- Don't warn about unused bindings with parents in + -- .hs-boot files, as you are sometimes required to give + -- unused bindings (trac #3449). + gres' = if isBoot then filter noParent gres + else gres + warnUnusedGREs gres' warnUnusedLocalBinds, warnUnusedMatches :: [Name] -> FreeVars -> RnM () warnUnusedLocalBinds = check_unused Opt_WarnUnusedBinds