From: simonmar Date: Fri, 6 Sep 2002 13:51:38 +0000 (+0000) Subject: [project @ 2002-09-06 13:51:38 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1715 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=21a8a75dea056a39315366b28def7388fc5b095e;p=ghc-hetmet.git [project @ 2002-09-06 13:51:38 by simonmar] Disallow 'ForeignPtr' as an FFI argument type. It has been deprecated for some time (withForeignPtr is the approved way to pass a ForeignPtr). The changes I'm about to make to ForeignPtr will stop it working anyhow. --- diff --git a/ghc/compiler/typecheck/TcForeign.lhs b/ghc/compiler/typecheck/TcForeign.lhs index 87950e6..9af2428 100644 --- a/ghc/compiler/typecheck/TcForeign.lhs +++ b/ghc/compiler/typecheck/TcForeign.lhs @@ -43,7 +43,7 @@ import TcType ( Type, tcSplitFunTys, tcSplitTyConApp_maybe, isFFIArgumentTy, isFFIImportResultTy, isFFIExportResultTy, isFFILabelTy, isFFIExternalTy, isFFIDynArgumentTy, - isFFIDynResultTy, isForeignPtrTy + isFFIDynResultTy, ) import ForeignCall ( CExportSpec(..), CCallTarget(..), CCallConv(..), isDynamicTarget, isCasmTarget ) @@ -251,11 +251,7 @@ checkForeignArgs pred tys = mapNF_Tc go tys `thenNF_Tc_` returnNF_Tc () where - go ty = check (pred ty) (illegalForeignTyErr argument ty) `thenNF_Tc_` - warnTc (isForeignPtrTy ty) foreignPtrWarn - -- - foreignPtrWarn = - text "`ForeignPtr' as argument type in a foreign import is deprecated" + go ty = check (pred ty) (illegalForeignTyErr argument ty) ------------ Checking result types for foreign calls ---------------------- -- Check that the type has the form