Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : ghc-7.6
http://hackage.haskell.org/trac/ghc/changeset/da26f6c38c22158f698ec75d910ebe4a61923d25 >--------------------------------------------------------------- commit da26f6c38c22158f698ec75d910ebe4a61923d25 Author: Simon Peyton Jones <simo...@microsoft.com> Date: Mon Oct 15 15:07:16 2012 +0100 Wrap a bracket quotation in a coercion that makes it have the right type This is the right fix to Trac #7276 (part 2), which makes the interaction with -fdefer-type-errors and TH work properly. >--------------------------------------------------------------- compiler/typecheck/TcSplice.lhs | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/typecheck/TcSplice.lhs b/compiler/typecheck/TcSplice.lhs index 4f3731a..21d0a1d 100644 --- a/compiler/typecheck/TcSplice.lhs +++ b/compiler/typecheck/TcSplice.lhs @@ -349,22 +349,22 @@ tcBracket brack res_ty -- We build a single implication constraint with a BracketSkol; -- that in turn tells simplifyCheck to report only definite -- errors - ; (_,lie) <- captureConstraints $ - newImplication BracketSkol [] [] $ - setStage brack_stage $ - do { meta_ty <- tc_bracket cur_stage brack - ; unifyType meta_ty res_ty } + ; ((_binds1, meta_ty), lie) <- captureConstraints $ + newImplication BracketSkol [] [] $ + setStage brack_stage $ + tc_bracket cur_stage brack -- It's best to simplify the constraint now, even though in -- principle some later unification might be useful for it, -- because we don't want these essentially-junk TH implication -- contraints floating around nested inside other constraints -- See for example Trac #4949 - ; _ <- simplifyTop lie + ; _binds2 <- simplifyTop lie -- Return the original expression, not the type-decorated one ; pendings <- readMutVar pending_splices - ; return (noLoc (HsBracketOut brack pendings)) } + ; co <- unifyType meta_ty res_ty + ; return (noLoc (mkHsWrapCo co (HsBracketOut brack pendings))) } tc_bracket :: ThStage -> HsBracket Name -> TcM TcType tc_bracket outer_stage br@(VarBr _ name) -- Note [Quoting names] _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc