Commit 4e2121f4 authored by dterei's avatar dterei
Browse files

Fix some validation errors

parent 1d6c2cf9
...@@ -1037,12 +1037,6 @@ safeLanguageOn dflags = safeHaskell dflags == Sf_Safe ...@@ -1037,12 +1037,6 @@ safeLanguageOn dflags = safeHaskell dflags == Sf_Safe
safeInferOn :: DynFlags -> Bool safeInferOn :: DynFlags -> Bool
safeInferOn dflags = safeHaskell dflags == Sf_SafeInfered 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 -- | Test if Safe Imports are on in some form
safeImportsOn :: DynFlags -> Bool safeImportsOn :: DynFlags -> Bool
safeImportsOn dflags = safeHaskell dflags == Sf_Unsafe || safeImportsOn dflags = safeHaskell dflags == Sf_Unsafe ||
......
...@@ -904,7 +904,7 @@ checkSafeImports dflags hsc_env tcg_env ...@@ -904,7 +904,7 @@ checkSafeImports dflags hsc_env tcg_env
-- See the Note [ Safe Haskell Inference] -- See the Note [ Safe Haskell Inference]
when (not $ isEmptyBag errs) ( when (not $ isEmptyBag errs) (
-- did we fail safe inference or fail -XSafe? -- did we fail safe inference or fail -XSafe?
case safeHaskell dflags == Sf_SafeInfered of case safeInferOn dflags of
True -> setDynFlags (dflags { safeHaskell = Sf_None } ) True -> setDynFlags (dflags { safeHaskell = Sf_None } )
False -> liftIO . throwIO . mkSrcErr $ errs 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