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.
\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)