@@ -190,6 +190,11 @@ pprintTerm ist = pprintTerm' ist []
190pprintTerm' :: IState -> [(Name, Bool)] -> PTerm -> Doc OutputAnnotation
190pprintTerm' :: IState -> [(Name, Bool)] -> PTerm -> Doc OutputAnnotation
191pprintTerm' ist bnd tm = pprintPTerm (ppOptionIst ist) bnd [] (idris_infixes ist) tm
191pprintTerm' ist bnd tm = pprintPTerm (ppOptionIst ist) bnd [] (idris_infixes ist) tm
193+pprintProv :: IState -> [(Name, Term)] -> Provenance -> Doc OutputAnnotation
194+pprintProv i e ExpectedType = text "Expected type"
195+pprintProv i e (SourceTerm tm)
196+ = text "Type of " <> pprintTerm' i (zip (map fst e) (repeat False)) (delab i tm)
193pprintErr :: IState -> Err -> Doc OutputAnnotation
198pprintErr :: IState -> Err -> Doc OutputAnnotation
194pprintErr i err = pprintErr' i (fmap (errReverse i) err)
199pprintErr i err = pprintErr' i (fmap (errReverse i) err)
@@ -204,10 +209,18 @@ pprintErr' i (CantUnify _ (x_in, xprov) (y_in, yprov) e sc s) =
204 (x, y) = addImplicitDiffs (delab i x_ns) (delab i y_ns) in
209 (x, y) = addImplicitDiffs (delab i x_ns) (delab i y_ns) in
205 text "Can't unify" <> indented (annTm x_ns
210 text "Can't unify" <> indented (annTm x_ns
206 (pprintTerm' i (map (\ (n, b) -> (n, False)) sc
211 (pprintTerm' i (map (\ (n, b) -> (n, False)) sc
207− ++ zip nms (repeat False)) x)) <$>
212+ ++ zip nms (repeat False)) x))
215+ Just t -> text " (" <> pprintProv i sc t <> text ")"
208 text "with" <> indented (annTm y_ns
217 text "with" <> indented (annTm y_ns
209 (pprintTerm' i (map (\ (n, b) -> (n, False)) sc
218 (pprintTerm' i (map (\ (n, b) -> (n, False)) sc
210− ++ zip nms (repeat False)) y)) <>
219+ ++ zip nms (repeat False)) y))
222+ Just t -> text " (" <> pprintProv i sc t <> text ")"
211 case e of
224 case e of
212 Msg "" -> empty
225 Msg "" -> empty
213 -- if the specific error is the same as the one we just printed,
226 -- if the specific error is the same as the one we just printed,