Commit b558599b authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Revert "Fix some validation errors"

This reverts commit 4e2121f4.
parent 4f792054
......@@ -1037,6 +1037,12 @@ safeLanguageOn dflags = safeHaskell dflags == Sf_Safe
safeInferOn :: DynFlags -> Bool
safeInferOn dflags = safeHaskell dflags == Sf_SafeInfered
-- | Turn off Safe Haskell inference mode (set module to unsafe)
setSafeInferOff :: DynFlags -> DynFlags
setSafeInferOff dflags
| safeHaskell dflags == Sf_SafeInfered = dflags { safeHaskell = Sf_None }
| otherwise = dflags
-- | Test if Safe Imports are on in some form
safeImportsOn :: DynFlags -> Bool
safeImportsOn dflags = safeHaskell dflags == Sf_Unsafe ||
......
......@@ -904,7 +904,7 @@ checkSafeImports dflags hsc_env tcg_env
-- See the Note [ Safe Haskell Inference]
when (not $ isEmptyBag errs) (
-- did we fail safe inference or fail -XSafe?
case safeInferOn dflags of
case safeHaskell dflags == Sf_SafeInfered of
True -> setDynFlags (dflags { safeHaskell = Sf_None } )
False -> liftIO . throwIO . mkSrcErr $ errs
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment