[Git][ghc/ghc][wip/T16689] SafeHaskell: Don't throw -Wsafe warning if module is declared Safe

Ben Gamari gitlab at gitlab.haskell.org
Fri Jun 14 03:51:47 UTC 2019



Ben Gamari pushed to branch wip/T16689 at Glasgow Haskell Compiler / GHC


Commits:
6ce3b61e by Ben Gamari at 2019-06-14T03:51:24Z
SafeHaskell: Don't throw -Wsafe warning if module is declared Safe

Fixes #16689.

- - - - -


1 changed file:

- compiler/main/HscMain.hs


Changes:

=====================================
compiler/main/HscMain.hs
=====================================
@@ -520,7 +520,9 @@ tcRnModule' sum save_rn_syntax mod = do
                  safe <- liftIO $ fst <$> readIORef (tcg_safeInfer tcg_res')
                  when safe $ do
                    case wopt Opt_WarnSafe dflags of
-                     True -> (logWarnings $ unitBag $
+                     True
+                       | safeHaskell dflags == Sf_Safe -> return ()
+                       | otherwise -> (logWarnings $ unitBag $
                               makeIntoWarning (Reason Opt_WarnSafe) $
                               mkPlainWarnMsg dflags (warnSafeOnLoc dflags) $
                               errSafe tcg_res')



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/6ce3b61e2e21a75f331221141a35e063afdb18e4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/6ce3b61e2e21a75f331221141a35e063afdb18e4
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190613/259583d7/attachment.html>


More information about the ghc-commits mailing list