eval: Improve ExprConcatStrings error messages and positions

"while evaluating a path segment" was just plain wrong

Co-authored-by: eldritch horrors <pennae@lix.systems>
Change-Id: I827374635df2887d17a8ee8b1755c078bf0b506b
This commit is contained in:
piegames
2026-04-30 17:14:43 +02:00
co-authored by eldritch horrors
parent 7017def185
commit 8782c7533f
8 changed files with 30 additions and 25 deletions
@@ -13,10 +13,10 @@ Expect the trace to not contain any traceback:
nix-repl> f 2
error:
… while evaluating a path segment
at «string»:1:13:
… while concatenating
at «string»:1:11:
1| f = a: "" + a
| ^
| ^
error: cannot coerce an integer to a string: 2
@@ -37,10 +37,10 @@ Expect the trace to have traceback:
1| f = a: "" + a
| ^
… while evaluating a path segment
at «string»:1:13:
… while concatenating
at «string»:1:11:
1| f = a: "" + a
| ^
| ^
error: cannot coerce an integer to a string: 2
@@ -51,9 +51,9 @@ Turning it off should also work:
nix-repl> f 2
error:
… while evaluating a path segment
at «string»:1:13:
… while concatenating
at «string»:1:11:
1| f = a: "" + a
| ^
| ^
error: cannot coerce an integer to a string: 2