lix/doc/manual/rl-next/with-error-reporting.md
jade 272db8af1b doc: add release note credits and categories for all the changes in Lix
This does not add missing release notes, and it doesn't do anything
about the profiles feature we would really like to have so we can have
consistent credit.

Change-Id: I72a6f7acfcff85f380be17dac76501a6f4693776
2024-05-15 14:33:35 -07:00

837 B

synopsis prs cls credits category
Better error reporting for `with` expressions 9658 207 horrors Improvements

with expressions using non-attrset values to resolve variables are now reported with proper positions.

Previously an incorrect with expression would report no position at all, making it hard to determine where the error originated:

nix-repl> with 1; a
error:
       … <borked>

         at «none»:0: (source not available)

       error: value is an integer while a set was expected

Now position information is preserved and reported as with most other errors:

nix-repl> with 1; a
error:
       … while evaluating the first subexpression of a with expression
         at «string»:1:1:
            1| with 1; a
             | ^

       error: expected a set but found an integer: 1