on master help sign in
Fix name propagation in error messages

Fixes #1225

commit921b766c2d2bb346d39a7f311d71aac85222b4a9 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateThu 5 Jun 2014, 15:07 (12 years ago) parent34d6f39
4 files changed+9−5
src/Idris/Core/ProofState.hs+4 src/Idris/ElabTerm.hs+1−1 test/reg034/expected+2−2 test/tutorial006/expected+2−2
src/Idris/Core/ProofState.hs+4
@@ -823,6 +823,10 @@ updateEnv ns [] = []
823823updateEnv ns ((n, b) : env) = (n, fmap (updateSolved ns) b) : updateEnv ns env
824824
825825updateError [] err = err
826+updateError ns (At f e) = At f (updateError ns e)
827+updateError ns (Elaborating s n e) = Elaborating s n (updateError ns e)
828+updateError ns (ElaboratingArg f a env e)
829+ = ElaboratingArg f a env (updateError ns e)
826830updateError ns (CantUnify b l r e xs sc)
827831 = CantUnify b (updateSolved ns l) (updateSolved ns r) (updateError ns e) xs sc
828832updateError ns e = e
src/Idris/ElabTerm.hs+1−1
@@ -70,7 +70,7 @@ build ist info pattern opts fn tm
7070
7171 when (not pattern) $
7272 traceWhen u ("Remaining holes:\n" ++ show hs ++ "\n" ++
73− "Remaining problems:\n" ++ show probs) $
73+ "Remaining problems:\n" ++ qshow probs) $
7474 do unify_all; matchProblems True; unifyProblems
7575
7676 probs <- get_probs
test/reg034/expected+2−2
@@ -1,7 +1,7 @@
11reg034.idr:6:5:When elaborating left hand side of bar:
22When elaborating an application of main.bar:
33 Can't unify
4− x = x
4+ length ys = length ys
55 with
66 length xs = length ys
77
@@ -13,7 +13,7 @@ When elaborating an application of main.bar:
1313reg034.idr:9:5:When elaborating left hand side of foo:
1414When elaborating an application of main.foo:
1515 Can't unify
16− x = x
16+ f y = f y
1717 with
1818 f x = f y
1919
test/tutorial006/expected+2−2
@@ -1,13 +1,13 @@
11tutorial006a.idr:3:23:When elaborating right hand side of vapp:
22When elaborating argument xs to constructor Prelude.Vect.:::
33 Can't unify
4− Vect (n + m) a
4+ Vect (n + n) a
55 with
66 Vect (plus n m) a
77
88 Specifically:
99 Can't unify
10− plus n m
10+ plus n n
1111 with
1212 plus n m
1313tutorial006b.idr:10:10:When elaborating right hand side of Main.parity: