From: simonpj Date: Mon, 2 Dec 2002 16:58:33 +0000 (+0000) Subject: [project @ 2002-12-02 16:58:33 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1393 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bd87e78712f1383979e9502dc9045d74e9b2e651;p=ghc-hetmet.git [project @ 2002-12-02 16:58:33 by simonpj] Remember to zapToType in tcSpliceExpr --- diff --git a/ghc/compiler/typecheck/TcSplice.lhs b/ghc/compiler/typecheck/TcSplice.lhs index 94e9c0e..41352b8 100644 --- a/ghc/compiler/typecheck/TcSplice.lhs +++ b/ghc/compiler/typecheck/TcSplice.lhs @@ -27,7 +27,7 @@ import TcSimplify ( tcSimplifyTop ) import TcType ( TcType, openTypeKind, mkAppTy ) import TcEnv ( spliceOK, tcMetaTy ) import TcRnTypes ( TopEnv(..) ) -import TcMType ( newTyVarTy ) +import TcMType ( newTyVarTy, zapToType ) import Name ( Name ) import TcRnMonad @@ -99,11 +99,12 @@ tcSpliceExpr name expr res_ty Brack _ ps_var lie_var -> -- A splice inside brackets - -- NB: ignore res_ty + -- NB: ignore res_ty, apart from zapping it to a mono-type -- e.g. [| reverse $(h 4) |] -- Here (h 4) :: Q Exp -- but $(h 4) :: forall a.a i.e. anything! + zapToType res_ty `thenM_` tcMetaTy exprTyConName `thenM` \ meta_exp_ty -> setStage (Splice next_level) ( setLIEVar lie_var $