From cda70f58ef004fd5b91749ab4f87f4589bebec45 Mon Sep 17 00:00:00 2001 From: chak Date: Wed, 20 Nov 2002 12:34:43 +0000 Subject: [PATCH] [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. --- ghc/compiler/typecheck/TcRnDriver.lhs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 1.7.10.4