From 6157da7b774e63f53204e26a6e79e27696f1bb42 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 11 Apr 2003 13:04:37 +0000 Subject: [PATCH] [project @ 2003-04-11 13:04:37 by simonmar] The Id for a foreign import should be a LocalId, not a GlobalId. Making it a GlobalId violates the invariant that all Ids defined in the current module should be LocalIds until CoreTidy. --- ghc/compiler/typecheck/TcForeign.lhs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/typecheck/TcForeign.lhs b/ghc/compiler/typecheck/TcForeign.lhs index bcf44f1..1748128 100644 --- a/ghc/compiler/typecheck/TcForeign.lhs +++ b/ghc/compiler/typecheck/TcForeign.lhs @@ -86,10 +86,10 @@ tcFImport fo@(ForeignImport nm hs_ty imp_decl isDeprec src_loc) -- of the foreign type. (_, t_ty) = tcSplitForAllTys sig_ty (arg_tys, res_ty) = tcSplitFunTys t_ty - id = mkVanillaGlobal nm sig_ty noCafIdInfo - -- Foreign-imported things don't neeed zonking etc - -- They are rather like constructors; we make the final - -- Global Id right away. + id = mkLocalId nm sig_ty + -- Use a LocalId to obey the invariant that locally-defined + -- things are LocalIds. However, it does not need zonking, + -- (so TcHsSyn.zonkForeignExports ignores it). in tcCheckFIType sig_ty arg_tys res_ty imp_decl `thenM_` -- can't use sig_ty here because it :: Type and we need HsType Id -- 1.7.10.4