From: sof Date: Thu, 8 Nov 2001 19:20:55 +0000 (+0000) Subject: [project @ 2001-11-08 19:20:55 by sof] X-Git-Tag: Approximately_9120_patches~592 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=56883a7f06775ed47b21f5ff5c0c31ed99665195;p=ghc-hetmet.git [project @ 2001-11-08 19:20:55 by sof] rnHsForeignDecl: 'foreign import's (incl 'f.e.d's) _define_ local toplevel names, so better use RnEnv.lookupTopBndrRn and not RnEnv.lookupOccRn to resolve the name. As was, declaring ForeignImports with the same name as an imported entity wasn't permitted. --- diff --git a/ghc/compiler/rename/RnSource.lhs b/ghc/compiler/rename/RnSource.lhs index f98124d..b74e3e7 100644 --- a/ghc/compiler/rename/RnSource.lhs +++ b/ghc/compiler/rename/RnSource.lhs @@ -130,7 +130,7 @@ rnSourceDecl (DefD (DefaultDecl tys src_loc)) \begin{code} rnHsForeignDecl (ForeignImport name ty spec src_loc) = pushSrcLocRn src_loc $ - lookupOccRn name `thenRn` \ name' -> + lookupTopBndrRn name `thenRn` \ name' -> rnHsTypeFVs (fo_decl_msg name) ty `thenRn` \ (ty', fvs1) -> lookupOrigNames (extras spec) `thenRn` \ fvs2 -> returnRn (ForeignImport name' ty' spec src_loc, fvs1 `plusFV` fvs2)