summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorsimonpj <unknown>2005-08-09 16:58:39 +0000
committersimonpj <unknown>2005-08-09 16:58:39 +0000
commit17d0932b746599cba8f504bedf45fd5236885677 (patch)
treee335b497eecff9f4bab8f7245cf0a5b519a23ce5 /ghc
parent70afe911563dcdc3e5fe4ed79fd944e6f0c64419 (diff)
downloadhaskell-17d0932b746599cba8f504bedf45fd5236885677.tar.gz
[project @ 2005-08-09 16:58:39 by simonpj]
Wibble to loadHomeInterface for TH quoting; MERGE to STABLE
Diffstat (limited to 'ghc')
-rw-r--r--ghc/compiler/iface/LoadIface.lhs12
-rw-r--r--ghc/compiler/rename/RnExpr.lhs9
2 files changed, 14 insertions, 7 deletions
diff --git a/ghc/compiler/iface/LoadIface.lhs b/ghc/compiler/iface/LoadIface.lhs
index 70e09c9624..f24cb64b81 100644
--- a/ghc/compiler/iface/LoadIface.lhs
+++ b/ghc/compiler/iface/LoadIface.lhs
@@ -40,7 +40,7 @@ import PrelRules ( builtinRules )
import Rules ( extendRuleBaseList, mkRuleBase )
import InstEnv ( emptyInstEnv, extendInstEnvList )
import Name ( Name {-instance NamedThing-}, getOccName,
- nameModule, isInternalName, isWiredInName )
+ nameModule, nameIsLocalOrFrom, isWiredInName )
import NameEnv
import MkId ( seqId )
import Module ( Module, ModLocation(ml_hi_file), emptyModuleEnv,
@@ -101,8 +101,14 @@ loadOrphanModules mods
---------------
loadHomeInterface :: SDoc -> Name -> TcRn ModIface
loadHomeInterface doc name
- = ASSERT2( not (isInternalName name), ppr name <+> parens doc )
- initIfaceTcRn $ loadSysInterface doc (nameModule name)
+ = do {
+#ifdef DEBUG
+ -- Should not be called with a name from the module being compiled
+ this_mod <- getModule
+ ; ASSERT2( not (nameIsLocalOrFrom this_mod name), ppr name <+> parens doc )
+#endif
+ initIfaceTcRn $ loadSysInterface doc (nameModule name)
+ }
---------------
loadWiredInHomeIface :: Name -> IfM lcl ()
diff --git a/ghc/compiler/rename/RnExpr.lhs b/ghc/compiler/rename/RnExpr.lhs
index ad7ddc522b..c252080670 100644
--- a/ghc/compiler/rename/RnExpr.lhs
+++ b/ghc/compiler/rename/RnExpr.lhs
@@ -33,7 +33,7 @@ import BasicTypes ( FixityDirection(..) )
import PrelNames ( hasKey, assertIdKey, assertErrorName,
loopAName, choiceAName, appAName, arrAName, composeAName, firstAName,
negateName, thenMName, bindMName, failMName )
-import Name ( Name, nameOccName )
+import Name ( Name, nameOccName, nameIsLocalOrFrom )
import NameSet
import RdrName ( RdrName, emptyGlobalRdrEnv, extendLocalRdrEnv, lookupLocalRdrEnv )
import LoadIface ( loadHomeInterface )
@@ -528,9 +528,10 @@ rnRbinds str rbinds
\begin{code}
rnBracket (VarBr n) = do { name <- lookupOccRn n
- ; loadHomeInterface msg name -- Reason: deprecation checking asumes the
- -- home interface is loaded, and this is the
- -- only way that is going to happen
+ ; this_mod <- getModule
+ ; checkM (nameIsLocalOrFrom this_mod name) $ -- Reason: deprecation checking asumes the
+ do { loadHomeInterface msg name -- home interface is loaded, and this is the
+ ; return () } -- only way that is going to happen
; returnM (VarBr name, unitFV name) }
where
msg = ptext SLIT("Need interface for Template Haskell quoted Name")