Skip to content
Snippets Groups Projects
Commit 6ce3b61e authored by Ben Gamari's avatar Ben Gamari
Browse files

SafeHaskell: Don't throw -Wsafe warning if module is declared Safe

Fixes #16689.
parent b0224209
1 merge request!1194SafeHaskell: Don't throw -Wsafe warning if module is declared Safe
Pipeline #7123 passed with warnings
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment