[project @ 2002-11-20 15:40:32 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcRnDriver.lhs
index 3755249..8a3ca32 100644 (file)
@@ -16,7 +16,8 @@ module TcRnDriver (
 #include "HsVersions.h"
 
 #ifdef GHCI
-import {-# SOURCE #-} TcSplice( tcSpliceDecls )
+import {-# SOURCE #-} TcSplice ( tcSpliceDecls )
+import               DsMeta   ( qTyConName )
 #endif
 
 import CmdLineOpts     ( DynFlag(..), opt_PprStyle_Debug, dopt )
@@ -100,7 +101,7 @@ import HscTypes             ( PersistentCompilerState(..), InteractiveContext(..),
                          ModIface, ModDetails(..), ModGuts(..),
                          HscEnv(..), 
                          ModIface(..), ModDetails(..), IfaceDecls(..),
-                         GhciMode(..), Dependencies(..), noDependencies,
+                         GhciMode(..), noDependencies,
                          Deprecations(..), plusDeprecs,
                          emptyGlobalRdrEnv,
                          GenAvailInfo(Avail), availsToNameSet, 
@@ -485,9 +486,16 @@ tcRnThing hsc_env pcs ictxt rdr_name
        do { addMessages (head msgs_s) ; failM }
     else do {
 
-    mapM_ addMessages msgs_s ; -- Add deprecation warnings
-    mapM tcLookupGlobal names  -- and lookup up the entities
-    }}
+       -- Add deprecation warnings
+    mapM_ addMessages msgs_s ; 
+
+       -- Slurp in the supporting declarations
+    tcg_env <- importSupportingDecls (mkFVs names) ;
+    setGblEnv tcg_env $ do {
+
+       -- And lookup up the entities
+    mapM tcLookupGlobal names
+    }}}
 \end{code}
 
 
@@ -608,7 +616,7 @@ tcRnSrcDecls ds
        (rn_splice_expr, fvs) <- initRn SourceMode $
                                 addSrcLoc splice_loc $
                                 rnExpr splice_expr ;
-       tcg_env <- importSupportingDecls fvs ;
+       tcg_env <- importSupportingDecls (fvs `addOneFV` qTyConName) ;
        setGblEnv tcg_env $ do {
 
        -- Execute the splice