From: chak Date: Wed, 20 Nov 2002 12:34:43 +0000 (+0000) Subject: [project @ 2002-11-20 12:34:42 by chak] X-Git-Tag: Approx_11550_changesets_converted~1425 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=cda70f58ef004fd5b91749ab4f87f4589bebec45 [project @ 2002-11-20 12:34:42 by chak] TH: - We are forcing importing THSyntax.Q at every top splice now; this suffices to get simple splices that do not involve reifyDecl or declaration quasi-quotes to work. NB: This worked already when the construction of the Dec term and the splice were in separated modules, but not when they are in the same (see the regression test "TH_spliceDecl1.hs"). - The tests "TH_spliceDecl2.hs" and "TH_spliceDecl3.hs" use toplevel splices together with quasi-quoted and reifyDecl. These currently still fail, as importing of some of the required type constructors from THSyntax isn't forced. --- diff --git a/ghc/compiler/typecheck/TcRnDriver.lhs b/ghc/compiler/typecheck/TcRnDriver.lhs index e557edf..d251db6 100644 --- a/ghc/compiler/typecheck/TcRnDriver.lhs +++ b/ghc/compiler/typecheck/TcRnDriver.lhs @@ -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 ) @@ -608,7 +609,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