From 56883a7f06775ed47b21f5ff5c0c31ed99665195 Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 8 Nov 2001 19:20:55 +0000 Subject: [PATCH] [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. --- ghc/compiler/rename/RnSource.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 1.7.10.4