From: simonpj Date: Tue, 9 Jul 2002 08:19:14 +0000 (+0000) Subject: [project @ 2002-07-09 08:19:14 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1877 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=75c431d16d01cb3b01f8d81d0520f43b4f9bac50;p=ghc-hetmet.git [project @ 2002-07-09 08:19:14 by simonpj] Improve error message *** MERGE TO STABLE BRANCH *** --- diff --git a/ghc/compiler/typecheck/TcExpr.lhs b/ghc/compiler/typecheck/TcExpr.lhs index c5e33f3..b84b488 100644 --- a/ghc/compiler/typecheck/TcExpr.lhs +++ b/ghc/compiler/typecheck/TcExpr.lhs @@ -136,13 +136,13 @@ tcMonoExpr (HsIPVar ip) res_ty \begin{code} tcMonoExpr in_expr@(ExprWithTySig expr poly_ty) res_ty - = tcHsSigType ExprSigCtxt poly_ty `thenTc` \ sig_tc_ty -> + = tcAddErrCtxt (exprSigCtxt in_expr) $ + tcHsSigType ExprSigCtxt poly_ty `thenTc` \ sig_tc_ty -> tcExpr expr sig_tc_ty `thenTc` \ (expr', lie1) -> -- Must instantiate the outer for-alls of sig_tc_ty -- else we risk instantiating a ? res_ty to a forall-type -- which breaks the invariant that tcMonoExpr only returns phi-types - tcAddErrCtxt (exprSigCtxt in_expr) $ tcInstCall SignatureOrigin sig_tc_ty `thenNF_Tc` \ (inst_fn, lie2, inst_sig_ty) -> tcSubExp res_ty inst_sig_ty `thenTc` \ (co_fn, lie3) ->