Commit 56883a7f authored by sof's avatar sof
Browse files

[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.
parent 0377a8db
......@@ -130,7 +130,7 @@ rnSourceDecl (DefD (DefaultDecl tys src_loc))
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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment