Commit 00227c6a authored by simonpj's avatar simonpj
Browse files

[project @ 2003-02-20 13:23:47 by simonpj]

-------------------------------------
	   Complete an earlier TH commit
	-------------------------------------

In this earlier commit:

  3.  Ensure that a declaration quotation [d| ... |] does not have a
      permanent effect on the instance environment. (A TH fix.)

I had forgotten to do a stage2 compile.  This commit just completes
the earlier work.  I moved some code from TcExpr (long) to TcSplice
(shorter) which had the happy effect of bringing related code together.
parent 72c98446
......@@ -13,7 +13,6 @@ import {-# SOURCE #-} TcSplice( tcSpliceExpr, tcBracket )
import HsSyn ( HsReify(..), ReifyFlavour(..) )
import TcType ( isTauTy )
import TcEnv ( bracketOK, tcMetaTy, checkWellStaged, metaLevel )
import TcSimplify ( tcSimplifyBracket )
import Name ( isExternalName )
import qualified DsMeta
#endif
......@@ -616,7 +615,7 @@ tcMonoExpr (PArrSeqIn _) _
-- Rename excludes these cases otherwise
tcMonoExpr (HsSplice n expr loc) res_ty = addSrcLoc loc (tcSpliceExpr n expr res_ty)
tcMonoExpr (HsBracket brack loc) res_ty = addSrcLoc loc (tcBracket brack)
tcMonoExpr (HsBracket brack loc) res_ty = addSrcLoc loc (tcBracket brack res_ty)
tcMonoExpr (HsReify (Reify flavour name)) res_ty
= addErrCtxt (ptext SLIT("At the reification of") <+> ppr name) $
......
......@@ -5,8 +5,10 @@ tcSpliceExpr :: Name.Name
-> TcType.TcType
-> TcRnTypes.TcM TcHsSyn.TcExpr
tcBracket :: HsExpr.HsBracket Name.Name
-> TcType.TcType
-> TcRnTypes.TcM TcHsSyn.TcExpr
tcSpliceDecls :: RnHsSyn.RenamedHsExpr
-> TcRnTypes.TcM [RdrHsSyn.RdrNameHsDecl]
tcBracket :: HsExpr.HsBracket Name.Name
-> TcRnTypes.TcM TcType.TcType
\ No newline at end of file
......@@ -16,16 +16,17 @@ import TcRnDriver ( importSupportingDecls, tcTopSrcDecls )
import qualified Language.Haskell.THSyntax as Meta
import HscTypes ( HscEnv(..), GhciMode(..), PersistentCompilerState(..), unQualInScope )
import HsSyn ( HsBracket(..) )
import HsSyn ( HsBracket(..), HsExpr(..) )
import Convert ( convertToHsExpr, convertToHsDecls )
import RnExpr ( rnExpr )
import RdrHsSyn ( RdrNameHsExpr, RdrNameHsDecl )
import RnHsSyn ( RenamedHsExpr )
import TcExpr ( tcMonoExpr )
import TcHsSyn ( TcExpr, TypecheckedHsExpr, mkHsLet, zonkTopExpr )
import TcSimplify ( tcSimplifyTop )
import TcSimplify ( tcSimplifyTop, tcSimplifyBracket )
import TcUnify ( unifyTauTy )
import TcType ( TcType, openTypeKind, mkAppTy )
import TcEnv ( spliceOK, tcMetaTy, tcWithTempInstEnv )
import TcEnv ( spliceOK, tcMetaTy, tcWithTempInstEnv, bracketOK )
import TcRnTypes ( TopEnv(..) )
import TcMType ( newTyVarTy, zapToType )
import Name ( Name )
......@@ -68,8 +69,8 @@ tcSpliceDecls e = pprPanic "Cant do tcSpliceDecls without GHCi" (ppr e)
%************************************************************************
\begin{code}
tcBracket :: HsBracket Name -> TcM TcType
tcBracket brack
tcBracket :: HsBracket Name -> TcType -> TcM TcExpr
tcBracket brack res_ty
= getStage `thenM` \ level ->
case bracketOK level of {
Nothing -> failWithTc (illegalBracket level) ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment