[commit: ghc] type-holes-branch: Fix the construction of the constraint, so it gets the right [ErrCtxt], and so it can be properly located. (f377504)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : type-holes-branch

http://hackage.haskell.org/trac/ghc/changeset/f37750475b13c255e9e1e207171381cabf1dadfe

>---------------------------------------------------------------

commit f37750475b13c255e9e1e207171381cabf1dadfe
Author: Thijs Alkemade <[email protected]>
Date:   Thu Aug 30 21:10:03 2012 +0200

    Fix the construction of the constraint, so it gets the right [ErrCtxt], and so it can be properly located.
    
    Like:
    
    In an expression: ...
    In an equation for ...

>---------------------------------------------------------------

 compiler/typecheck/TcExpr.lhs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/typecheck/TcExpr.lhs b/compiler/typecheck/TcExpr.lhs
index c1b12ff..7da963c 100644
--- a/compiler/typecheck/TcExpr.lhs
+++ b/compiler/typecheck/TcExpr.lhs
@@ -236,9 +236,9 @@ tcExpr HsHole res_ty
       ; traceTc "tcExpr.HsHole" (ppr ty)
       ; lenv <- getLclTypeEnv
       ; ev <- mkSysLocalM (mkFastString "_") ty
-      ; let loc = HoleOrigin lenv
-      ; span <- getSrcSpanM
-      ; let can = (CHoleCan (Wanted (CtLoc loc span []) ty ev) ty 0)
+      ; let origin = HoleOrigin lenv
+      ; loc <- getCtLoc origin
+      ; let can = (CHoleCan (Wanted loc ty ev) ty 0)
       ; traceTc "tcExpr.HsHole emitting" (ppr can)
       ; emitInsoluble can
       ; tcWrapResult (HsVar ev) ty res_ty }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.