diff options
author | Duncan Coutts <duncan@well-typed.com> | 2009-06-11 11:52:43 +0000 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2009-06-11 11:52:43 +0000 |
commit | f73446118d7168e238868b591be748ab0997045c (patch) | |
tree | 72e930a5ca8d1cd94e280417714f3ddcf5b481b0 | |
parent | cbbee4e8727c583daf32d9bf17f00afaa839ef10 (diff) | |
download | haskell-f73446118d7168e238868b591be748ab0997045c.tar.gz |
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).
-rw-r--r-- | compiler/typecheck/TcForeign.lhs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/typecheck/TcForeign.lhs b/compiler/typecheck/TcForeign.lhs index 23756d97c3..1a8a3f354c 100644 --- a/compiler/typecheck/TcForeign.lhs +++ b/compiler/typecheck/TcForeign.lhs @@ -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 (#,,#) |