diff options
Diffstat (limited to 'compiler/typecheck/TcRnDriver.hs')
-rw-r--r-- | compiler/typecheck/TcRnDriver.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index fdc6e5e638..385405f6a7 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -310,7 +310,8 @@ tcRnModuleTcRnM hsc_env hsc_src implicit_prelude import_decls } ; whenWOptM Opt_WarnImplicitPrelude $ - when (notNull prel_imports) $ addWarn (implicitPreludeWarn) ; + when (notNull prel_imports) $ + addWarn Opt_WarnImplicitPrelude (implicitPreludeWarn) ; tcg_env <- {-# SCC "tcRnImports" #-} tcRnImports hsc_env (prel_imports ++ import_decls) ; @@ -1286,7 +1287,7 @@ tcPreludeClashWarn warnFlag name = do ; traceTc "tcPreludeClashWarn/prelude_functions" (hang (ppr name) 4 (sep [ppr clashingElts])) - ; let warn_msg x = addWarnAt (nameSrcSpan (gre_name x)) (hsep + ; let warn_msg x = addWarnAt warnFlag (nameSrcSpan (gre_name x)) (hsep [ text "Local definition of" , (quotes . ppr . nameOccName . gre_name) x , text "clashes with a future Prelude name." ] @@ -1397,7 +1398,7 @@ tcMissingParentClassWarn warnFlag isName shouldName -- <should>" e.g. "Foo is an instance of Monad but not Applicative" ; let instLoc = srcLocSpan . nameSrcLoc $ getName isInst warnMsg (Just name:_) = - addWarnAt instLoc $ + addWarnAt warnFlag instLoc $ hsep [ (quotes . ppr . nameOccName) name , text "is an instance of" , (ppr . nameOccName . className) isClass |