[project @ 2002-11-20 12:34:42 by chak]
authorchak <unknown>
Wed, 20 Nov 2002 12:34:43 +0000 (12:34 +0000)
committerchak <unknown>
Wed, 20 Nov 2002 12:34:43 +0000 (12:34 +0000)
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

index e557edf..d251db6 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 )
@@ -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