summaryrefslogtreecommitdiff
path: root/compiler/main/DynamicLoading.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-06-03 11:43:53 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-06-03 11:46:17 +0100
commit7ea156ae3e1c66e59935f0eb877ea1a3f3bfd5b9 (patch)
tree9fe22f362259b215ab39b527c97558a143118131 /compiler/main/DynamicLoading.hs
parent7b6800c5ab62cb10b3c1b7a85e40c77897cc366f (diff)
downloadhaskell-7ea156ae3e1c66e59935f0eb877ea1a3f3bfd5b9.tar.gz
Refactor RdrName.Provenance, to fix #7672
Trac #7672 has a data type T in module A that is in scope *both* locally-bound *and* imported (with a qualified) name. The Provenance of a GlobalRdrElt simply couldn't express that before. Now you can. In doing so, I flattened out Provenance into GlobalRdrElt, so quite a lot of modules are touched in a not-very-interesting way.
Diffstat (limited to 'compiler/main/DynamicLoading.hs')
-rw-r--r--compiler/main/DynamicLoading.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/main/DynamicLoading.hs b/compiler/main/DynamicLoading.hs
index 546cc6879c..3b62717a9c 100644
--- a/compiler/main/DynamicLoading.hs
+++ b/compiler/main/DynamicLoading.hs
@@ -27,7 +27,7 @@ import SrcLoc ( noSrcSpan )
import Finder ( findImportedModule, cannotFindModule )
import TcRnMonad ( initTcInteractive, initIfaceTcRn )
import LoadIface ( loadPluginInterface )
-import RdrName ( RdrName, Provenance(..), ImportSpec(..), ImpDeclSpec(..)
+import RdrName ( RdrName, ImportSpec(..), ImpDeclSpec(..)
, ImpItemSpec(..), mkGlobalRdrEnv, lookupGRE_RdrName
, gre_name, mkRdrQual )
import OccName ( mkVarOcc )
@@ -221,8 +221,8 @@ lookupRdrNameInModuleForPlugins hsc_env mod_name rdr_name = do
-- Try and find the required name in the exports
let decl_spec = ImpDeclSpec { is_mod = mod_name, is_as = mod_name
, is_qual = False, is_dloc = noSrcSpan }
- provenance = Imported [ImpSpec decl_spec ImpAll]
- env = mkGlobalRdrEnv (gresFromAvails provenance (mi_exports iface))
+ imp_spec = ImpSpec decl_spec ImpAll
+ env = mkGlobalRdrEnv (gresFromAvails (Just imp_spec) (mi_exports iface))
case lookupGRE_RdrName rdr_name env of
[gre] -> return (Just (gre_name gre))
[] -> return Nothing