Merge pull request #1761 from bmsherman/dontDupErrors
Reduce redundant 'specifically' clauses in errors
commitc44a35c492c3d0f250e99e9919f0f93f09b0ad1d
authorEdwin Brady <edwin.brady@gmail.com>
dateThu 4 Dec 2014, 19:18 (12 years ago)
parent6f032cced81980
src/Idris/Delaborate.hs+3
@@ -205,6 +205,9 @@ pprintErr' i (CantUnify _ x_in y_in e sc s) =
205205 ++ zip nms (repeat False)) y)) <>
206206 case e of
207207 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
208211 _ -> line <> line <> text "Specifically:" <>
209212 indented (pprintErr' i e) <>
210213 if (opt_errContext (idris_options i)) then showSc i sc else empty
test/basic006/expected−6
@@ -4,11 +4,5 @@ When elaborating an application of function Prelude.List.reverse:
44 Vect n a
55 with
66 List a
7−
8− Specifically:
9− Can't unify
10− Vect n a
11− with
12− List a
137[3, 2, 1]
148"Number 42"
test/reg010/expected−6
@@ -3,9 +3,3 @@ Can't unify
33 P x
44with
55 P y
6−
7−Specifically:
8− Can't unify
9− P x
10− with
11− P y
test/reg023/expected−6
@@ -3,9 +3,3 @@ Can't unify
33 [94mNat[0m
44with
55 [92mf[0m [94mNat[0m
6−
7−Specifically:
8− Can't unify
9− [94mNat[0m
10− with
11− [92mf[0m [94mNat[0m