Commit c4874d4e authored by dterei's avatar dterei

Throw error if safe imports used when safe haskell isn't on

parent 7231f88b
......@@ -214,6 +214,10 @@ rnImportDecl this_mod
dflags <- getDOpts
warnIf (want_boot && not (mi_boot iface) && isOneShot (ghcMode dflags))
(warnRedundantSourceImport imp_mod_name)
when (mod_safe && not (safeImportsOn dflags)) $
addErrAt loc (ptext (sLit "safe import can't be used as Safe Haskell isn't on!")
$+$ ptext (sLit $ "please enable Safe Haskell through either"
++ "-XSafe, -XTruswrothy or -XUnsafe"))
let
imp_mod = mi_module iface
......
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