Commit f7344611 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Reverse the safe/unsafe requirement on foreign import prim

The safe/unsafe annotation doesn't currently mean anything for prim.
Just in case we decide it means something later it's better to stick
to using one or the other consistently. We decided that using safe
is the better one to require (and it's also the default).
parent cbbee4e8
......@@ -154,8 +154,8 @@ tcCheckFIType sig_ty arg_tys res_ty idecl@(CImport cconv safety _ _ (CFunction t
| cconv == PrimCallConv = do
checkCg (checkCOrAsmOrDotNetOrInterp)
checkCTarget target
check (safety == PlayRisky)
(text "A `foreign import prim' must always be annotated as `unsafe'")
check (playSafe safety)
(text "The safe/unsafe annotation should not be used with `foreign import prim'.")
dflags <- getDOpts
checkForeignArgs (isFFIPrimArgumentTy dflags) arg_tys
-- prim import result is more liberal, allows (#,,#)
Supports Markdown
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