From 75c431d16d01cb3b01f8d81d0520f43b4f9bac50 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 9 Jul 2002 08:19:14 +0000 Subject: [PATCH] [project @ 2002-07-09 08:19:14 by simonpj] Improve error message *** MERGE TO STABLE BRANCH *** --- ghc/compiler/typecheck/TcExpr.lhs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -> -- 1.7.10.4