[project @ 2002-09-25 11:46:02 by simonpj]
authorsimonpj <unknown>
Wed, 25 Sep 2002 11:46:02 +0000 (11:46 +0000)
committersimonpj <unknown>
Wed, 25 Sep 2002 11:46:02 +0000 (11:46 +0000)
Remember to import the things used by foreign export

ghc/compiler/rename/RnSource.lhs

index d90f63a..a368122 100644 (file)
@@ -301,7 +301,10 @@ rnHsForeignDecl (ForeignExport name ty spec isDeprec src_loc)
     lookupOccRn name                           `thenM` \ name' ->
     rnHsTypeFVs (fo_decl_msg name) ty                  `thenM` \ (ty', fvs) ->
     returnM (ForeignExport name' ty' spec isDeprec src_loc, 
-             mkFVs [bindIOName, returnIOName] `plusFV` fvs)
+             mkFVs [name', bindIOName, returnIOName] `plusFV` fvs )
+       -- NB: a foreign export is an *occurrence site* for name, so 
+       --     we add it to the free-variable list.  It might, for example,
+       --     be imported from another module
 
 fo_decl_msg name = ptext SLIT("In the foreign declaration for") <+> ppr name
 \end{code}