diff options
author | Alex Rozenshteyn <rpglover64@gmail.com> | 2015-08-21 21:42:16 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2015-08-22 00:00:55 +0200 |
commit | a5061a96724922097e4181d452a64618e35fa297 (patch) | |
tree | a2ad14d0f2ad59b968d2fc140a7e90ba89d0386a /compiler | |
parent | a1c008b30fc60a327afe098cf16bd14ca1e5e381 (diff) | |
download | haskell-a5061a96724922097e4181d452a64618e35fa297.tar.gz |
Check options before warning about source imports.
Summary: Fixes T10637
Reviewers: austin, bgamari, thomie
Subscribers: dfordivam, simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D1157
GHC Trac Issues: #10637
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/GhcMake.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index 7c3f95b44f..ba21e5b941 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -1544,7 +1544,8 @@ nodeMapElts = Map.elems warnUnnecessarySourceImports :: GhcMonad m => [SCC ModSummary] -> m () warnUnnecessarySourceImports sccs = do dflags <- getDynFlags - logWarnings (listToBag (concatMap (check dflags . flattenSCC) sccs)) + when (wopt Opt_WarnUnusedImports dflags) + (logWarnings (listToBag (concatMap (check dflags . flattenSCC) sccs))) where check dflags ms = let mods_in_this_cycle = map ms_mod_name ms in [ warn dflags i | m <- ms, i <- ms_home_srcimps m, |