Fix Trac #3193: improve line number reporting for equality constraints
[ghc-hetmet.git] / compiler / typecheck / TcRnMonad.lhs
index 8a0b4f4..a8146ba 100644 (file)
@@ -711,11 +711,11 @@ getInstLoc origin
   = do { loc <- getSrcSpanM ; env <- getLclEnv ;
         return (InstLoc origin loc (tcl_ctxt env)) }
 
-addInstCtxt :: InstLoc -> TcM a -> TcM a
+setInstCtxt :: InstLoc -> TcM a -> TcM a
 -- Add the SrcSpan and context from the first Inst in the list
 --     (they all have similar locations)
-addInstCtxt (InstLoc _ src_loc ctxt) thing_inside
-  = setSrcSpan src_loc (updCtxt (\_ -> ctxt) thing_inside)
+setInstCtxt (InstLoc _ src_loc ctxt) thing_inside
+  = setSrcSpan src_loc (setErrCtxt ctxt thing_inside)
 \end{code}
 
     The addErrTc functions add an error message, but do not cause failure.