on master help sign in
Reduce redundant 'specifically' clauses in errors
43cb5c7Ben Sherman
src/Idris/Delaborate.hs+3
@@ -205,6 +205,9 @@ pprintErr' i (CantUnify _ x_in y_in e sc s) =
205 ++ zip nms (repeat False)) y)) <>
205 ++ zip nms (repeat False)) y)) <>
206 case e of
206 case e of
207 Msg "" -> empty
207 Msg "" -> empty
208+ -- if the specific error is the same as the one we just printed,
209+ -- there's no need to print it
210+ CantUnify _ x_in' y_in' _ _ _ | x_in == x_in' && y_in == y_in' -> empty
208 _ -> line <> line <> text "Specifically:" <>
211 _ -> line <> line <> text "Specifically:" <>
209 indented (pprintErr' i e) <>
212 indented (pprintErr' i e) <>
210 if (opt_errContext (idris_options i)) then showSc i sc else empty
213 if (opt_errContext (idris_options i)) then showSc i sc else empty