Tag ForeignCalls with the package they correspond to
[ghc-hetmet.git] / compiler / typecheck / TcForeign.lhs
index 83f719b..1901357 100644 (file)
@@ -158,14 +158,21 @@ tcCheckFIType sig_ty arg_tys res_ty idecl@(CImport cconv safety _ (CFunction tar
       checkMissingAmpersand dflags arg_tys res_ty
       return idecl
 
+
 -- This makes a convenient place to check
 -- that the C identifier is valid for C
 checkCTarget :: CCallTarget -> TcM ()
 checkCTarget (StaticTarget str) = do
     checkCg checkCOrAsmOrDotNetOrInterp
     check (isCLabelString str) (badCName str)
+
+checkCTarget (PackageTarget str _) = do
+    checkCg checkCOrAsmOrDotNetOrInterp
+    check (isCLabelString str) (badCName str)
+
 checkCTarget DynamicTarget = panic "checkCTarget DynamicTarget"
 
+
 checkMissingAmpersand :: DynFlags -> [Type] -> Type -> TcM ()
 checkMissingAmpersand dflags arg_tys res_ty
   | null arg_tys && isFunPtrTy res_ty &&