1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

test: Fix shifted source positions after formatting

This commit is contained in:
Robert Hensing 2025-01-24 21:32:07 +01:00
parent 2f1b70a529
commit ae0bb7d71c
39 changed files with 332 additions and 319 deletions

View file

@ -1,9 +1,9 @@
error: error:
… while calling the 'addDrvOutputDependencies' builtin … while calling the 'addDrvOutputDependencies' builtin
at /pwd/lang/eval-fail-addDrvOutputDependencies-multi-elem-context.nix:18:4: at /pwd/lang/eval-fail-addDrvOutputDependencies-multi-elem-context.nix:25:1:
17| 24| in
18| in builtins.addDrvOutputDependencies combo-path 25| builtins.addDrvOutputDependencies combo-path
| ^ | ^
19| 26|
error: context of string '/nix/store/pg9yqs4yd85yhdm3f4i5dyaqp5jahrsz-fail.drv/nix/store/2dxd5frb715z451vbf7s8birlf3argbk-fail-2.drv' must have exactly one element, but has 2 error: context of string '/nix/store/pg9yqs4yd85yhdm3f4i5dyaqp5jahrsz-fail.drv/nix/store/2dxd5frb715z451vbf7s8birlf3argbk-fail-2.drv' must have exactly one element, but has 2

View file

@ -1,9 +1,9 @@
error: error:
… while calling the 'addDrvOutputDependencies' builtin … while calling the 'addDrvOutputDependencies' builtin
at /pwd/lang/eval-fail-addDrvOutputDependencies-wrong-element-kind.nix:9:4: at /pwd/lang/eval-fail-addDrvOutputDependencies-wrong-element-kind.nix:13:1:
8| 12| in
9| in builtins.addDrvOutputDependencies drv.outPath 13| builtins.addDrvOutputDependencies drv.outPath
| ^ | ^
10| 14|
error: `addDrvOutputDependencies` can only act on derivations, not on a derivation output such as 'out' error: `addDrvOutputDependencies` can only act on derivations, not on a derivation output such as 'out'

View file

@ -1,8 +1,8 @@
error: error:
… while evaluating the condition of the assertion '({ a = true; } == { a = true; b = true; })' … while evaluating the condition of the assertion '({ a = true; } == { a = true; b = true; })'
at /pwd/lang/eval-fail-assert-equal-attrs-names-2.nix:1:1: at /pwd/lang/eval-fail-assert-equal-attrs-names-2.nix:1:1:
1| assert { a = true; } == { a = true; b = true; }; 1| assert
| ^ | ^
2| throw "unreachable" 2| {
error: attribute names of attribute set '{ a = true; }' differs from attribute set '{ a = true; b = true; }' error: attribute names of attribute set '{ a = true; }' differs from attribute set '{ a = true; b = true; }'

View file

@ -1,8 +1,8 @@
error: error:
… while evaluating the condition of the assertion '({ a = true; b = true; } == { a = true; })' … while evaluating the condition of the assertion '({ a = true; b = true; } == { a = true; })'
at /pwd/lang/eval-fail-assert-equal-attrs-names.nix:1:1: at /pwd/lang/eval-fail-assert-equal-attrs-names.nix:1:1:
1| assert { a = true; b = true; } == { a = true; }; 1| assert
| ^ | ^
2| throw "unreachable" 2| {
error: attribute names of attribute set '{ a = true; b = true; }' differs from attribute set '{ a = true; }' error: attribute names of attribute set '{ a = true; b = true; }' differs from attribute set '{ a = true; }'

View file

@ -3,23 +3,23 @@ error:
at /pwd/lang/eval-fail-assert-equal-derivations-extra.nix:1:1: at /pwd/lang/eval-fail-assert-equal-derivations-extra.nix:1:1:
1| assert 1| assert
| ^ | ^
2| { foo = { type = "derivation"; outPath = "/nix/store/0"; }; } 2| {
… while comparing attribute 'foo' … while comparing attribute 'foo'
… where left hand side is … where left hand side is
at /pwd/lang/eval-fail-assert-equal-derivations-extra.nix:2:5: at /pwd/lang/eval-fail-assert-equal-derivations-extra.nix:3:5:
1| assert 2| {
2| { foo = { type = "derivation"; outPath = "/nix/store/0"; }; } 3| foo = {
| ^ | ^
3| == 4| type = "derivation";
… where right hand side is … where right hand side is
at /pwd/lang/eval-fail-assert-equal-derivations-extra.nix:4:5: at /pwd/lang/eval-fail-assert-equal-derivations-extra.nix:8:5:
3| == 7| } == {
4| { foo = { type = "derivation"; outPath = "/nix/store/1"; devious = true; }; }; 8| foo = {
| ^ | ^
5| throw "unreachable" 9| type = "derivation";
… while comparing a derivation by its 'outPath' attribute … while comparing a derivation by its 'outPath' attribute

View file

@ -3,23 +3,23 @@ error:
at /pwd/lang/eval-fail-assert-equal-derivations.nix:1:1: at /pwd/lang/eval-fail-assert-equal-derivations.nix:1:1:
1| assert 1| assert
| ^ | ^
2| { foo = { type = "derivation"; outPath = "/nix/store/0"; ignored = abort "not ignored"; }; } 2| {
… while comparing attribute 'foo' … while comparing attribute 'foo'
… where left hand side is … where left hand side is
at /pwd/lang/eval-fail-assert-equal-derivations.nix:2:5: at /pwd/lang/eval-fail-assert-equal-derivations.nix:3:5:
1| assert 2| {
2| { foo = { type = "derivation"; outPath = "/nix/store/0"; ignored = abort "not ignored"; }; } 3| foo = {
| ^ | ^
3| == 4| type = "derivation";
… where right hand side is … where right hand side is
at /pwd/lang/eval-fail-assert-equal-derivations.nix:4:5: at /pwd/lang/eval-fail-assert-equal-derivations.nix:9:5:
3| == 8| } == {
4| { foo = { type = "derivation"; outPath = "/nix/store/1"; ignored = abort "not ignored"; }; }; 9| foo = {
| ^ | ^
5| throw "unreachable" 10| type = "derivation";
… while comparing a derivation by its 'outPath' attribute … while comparing a derivation by its 'outPath' attribute

View file

@ -2,8 +2,8 @@ error:
… while evaluating the condition of the assertion '((x: x) == (x: x))' … while evaluating the condition of the assertion '((x: x) == (x: x))'
at /pwd/lang/eval-fail-assert-equal-function-direct.nix:3:1: at /pwd/lang/eval-fail-assert-equal-function-direct.nix:3:1:
2| # This only compares a direct comparison and makes no claims about functions in nested structures. 2| # This only compares a direct comparison and makes no claims about functions in nested structures.
3| assert 3| assert (x: x) == (x: x);
| ^ | ^
4| (x: x) 4| abort "unreachable"
error: distinct functions and immediate comparisons of identical functions compare as unequal error: distinct functions and immediate comparisons of identical functions compare as unequal

View file

@ -1,8 +1,8 @@
error: error:
… while evaluating the condition of the assertion '([ (1) (0) ] == [ (10) ])' … while evaluating the condition of the assertion '([ (1) (0) ] == [ (10) ])'
at /pwd/lang/eval-fail-assert-equal-list-length.nix:1:1: at /pwd/lang/eval-fail-assert-equal-list-length.nix:1:1:
1| assert [ 1 0 ] == [ 10 ]; 1| assert
| ^ | ^
2| throw "unreachable" 2| [
error: list of size '2' is not equal to list of size '1', left hand side is '[ 1 0 ]', right hand side is '[ 10 ]' error: list of size '2' is not equal to list of size '1', left hand side is '[ 1 0 ]', right hand side is '[ 10 ]'

View file

@ -1,74 +1,66 @@
error: error:
… while evaluating the condition of the assertion '({ a = { b = [ ({ c = { d = true; }; }) ]; }; } == { a = { b = [ ({ c = { d = false; }; }) ]; }; })' … while evaluating the condition of the assertion '({ a = { b = [ ({ c = { d = true; }; }) ]; }; } == { a = { b = [ ({ c = { d = false; }; }) ]; }; })'
at /pwd/lang/eval-fail-assert-nested-bool.nix:1:1: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:1:
1| assert 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
| ^ | ^
2| { a.b = [ { c.d = true; } ]; } 2|
… while comparing attribute 'a' … while comparing attribute 'a'
… where left hand side is … where left hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:2:5: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:10:
1| assert 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
2| { a.b = [ { c.d = true; } ]; }
| ^ | ^
3| == 2|
… where right hand side is … where right hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:4:5: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:44:
3| == 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
4| { a.b = [ { c.d = false; } ]; };
| ^ | ^
5| 2|
… while comparing attribute 'b' … while comparing attribute 'b'
… where left hand side is … where left hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:2:5: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:10:
1| assert 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
2| { a.b = [ { c.d = true; } ]; }
| ^ | ^
3| == 2|
… where right hand side is … where right hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:4:5: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:44:
3| == 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
4| { a.b = [ { c.d = false; } ]; };
| ^ | ^
5| 2|
… while comparing list element 0 … while comparing list element 0
… while comparing attribute 'c' … while comparing attribute 'c'
… where left hand side is … where left hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:2:15: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:20:
1| assert 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
2| { a.b = [ { c.d = true; } ]; }
| ^ | ^
3| == 2|
… where right hand side is … where right hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:4:15: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:54:
3| == 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
4| { a.b = [ { c.d = false; } ]; };
| ^ | ^
5| 2|
… while comparing attribute 'd' … while comparing attribute 'd'
… where left hand side is … where left hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:2:15: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:20:
1| assert 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
2| { a.b = [ { c.d = true; } ]; }
| ^ | ^
3| == 2|
… where right hand side is … where right hand side is
at /pwd/lang/eval-fail-assert-nested-bool.nix:4:15: at /pwd/lang/eval-fail-assert-nested-bool.nix:1:54:
3| == 1| assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; };
4| { a.b = [ { c.d = false; } ]; };
| ^ | ^
5| 2|
error: boolean 'true' is not equal to boolean 'false' error: boolean 'true' is not equal to boolean 'false'

View file

@ -1,30 +1,30 @@
error: error:
… while evaluating the attribute 'body' … while evaluating the attribute 'body'
at /pwd/lang/eval-fail-assert.nix:4:3: at /pwd/lang/eval-fail-assert.nix:7:3:
3| 6|
4| body = x "x"; 7| body = x "x";
| ^ | ^
5| } 8| }
… from call site … from call site
at /pwd/lang/eval-fail-assert.nix:4:10: at /pwd/lang/eval-fail-assert.nix:7:10:
3| 6|
4| body = x "x"; 7| body = x "x";
| ^ | ^
5| } 8| }
… while calling 'x' … while calling 'x'
at /pwd/lang/eval-fail-assert.nix:2:7: at /pwd/lang/eval-fail-assert.nix:3:5:
1| let { 2| x =
2| x = arg: assert arg == "y"; 123; 3| arg:
| ^ | ^
3| 4| assert arg == "y";
… while evaluating the condition of the assertion '(arg == "y")' … while evaluating the condition of the assertion '(arg == "y")'
at /pwd/lang/eval-fail-assert.nix:2:12: at /pwd/lang/eval-fail-assert.nix:4:5:
1| let { 3| arg:
2| x = arg: assert arg == "y"; 123; 4| assert arg == "y";
| ^ | ^
3| 5| 123;
error: string '"x"' is not equal to string '"y"' error: string '"x"' is not equal to string '"y"'

View file

@ -7,14 +7,14 @@ error:
4| }; 4| };
… while evaluating an attribute name … while evaluating an attribute name
at /pwd/lang/eval-fail-attr-name-type.nix:7:17: at /pwd/lang/eval-fail-attr-name-type.nix:7:15:
6| in 6| in
7| attrs.puppy.${key} 7| attrs.puppy.${key}
| ^ | ^
8| 8|
error: expected a string but found an integer: 1 error: expected a string but found an integer: 1
at /pwd/lang/eval-fail-attr-name-type.nix:7:17: at /pwd/lang/eval-fail-attr-name-type.nix:7:15:
6| in 6| in
7| attrs.puppy.${key} 7| attrs.puppy.${key}
| ^ | ^

View file

@ -1,5 +1,6 @@
error: undefined variable 'd' error: undefined variable 'd'
at /pwd/lang/eval-fail-attrset-merge-drops-later-rec.nix:1:26: at /pwd/lang/eval-fail-attrset-merge-drops-later-rec.nix:4:9:
1| { a.b = 1; a = rec { c = d + 2; d = 3; }; }.c 3| a = rec {
4| c = d + 2;
| ^ | ^
2| 5| d = 3;

View file

@ -1,9 +1,9 @@
error: error:
… while evaluating a path segment … while evaluating a path segment
at /pwd/lang/eval-fail-bad-string-interpolation-4.nix:9:3: at /pwd/lang/eval-fail-bad-string-interpolation-4.nix:19:3:
8| # The error message should not be too long. 18| # The error message should not be too long.
9| ''${pkgs}'' 19| ''${pkgs}''
| ^ | ^
10| 20|
error: cannot coerce a set to a string: { a = { a = { a = { a = "ha"; b = "ha"; c = "ha"; d = "ha"; e = "ha"; f = "ha"; g = "ha"; h = "ha"; j = "ha"; }; «8 attributes elided» }; «8 attributes elided» }; «8 attributes elided» } error: cannot coerce a set to a string: { a = { a = { a = { a = "ha"; b = "ha"; c = "ha"; d = "ha"; e = "ha"; f = "ha"; g = "ha"; h = "ha"; j = "ha"; }; «8 attributes elided» }; «8 attributes elided» }; «8 attributes elided» }

View file

@ -2,13 +2,13 @@ error:
… while evaluating the attribute 'set' … while evaluating the attribute 'set'
at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:2:3: at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:2:3:
1| { 1| {
2| set = { "${"" + "b"}" = 1; }; 2| set = {
| ^ | ^
3| set = { "${"b" + ""}" = 2; }; 3| "${"" + "b"}" = 1;
error: dynamic attribute 'b' already defined at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:2:11 error: dynamic attribute 'b' already defined at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:3:5
at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:3:11: at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:6:5:
2| set = { "${"" + "b"}" = 1; }; 5| set = {
3| set = { "${"b" + ""}" = 2; }; 6| "${"b" + ""}" = 2;
| ^ | ^
4| } 7| };

View file

@ -1,51 +1,51 @@
error: error:
… from call site … from call site
at /pwd/lang/eval-fail-duplicate-traces.nix:9:3: at /pwd/lang/eval-fail-duplicate-traces.nix:6:1:
8| in 5| in
9| throwAfter 2 6| throwAfter 2
| ^ | ^
10| 7|
… while calling 'throwAfter' … while calling 'throwAfter'
at /pwd/lang/eval-fail-duplicate-traces.nix:4:16: at /pwd/lang/eval-fail-duplicate-traces.nix:4:16:
3| let 3| let
4| throwAfter = n: 4| throwAfter = n: if n > 0 then throwAfter (n - 1) else throw "Uh oh!";
| ^ | ^
5| if n > 0 5| in
… from call site … from call site
at /pwd/lang/eval-fail-duplicate-traces.nix:6:10: at /pwd/lang/eval-fail-duplicate-traces.nix:4:33:
5| if n > 0 3| let
6| then throwAfter (n - 1) 4| throwAfter = n: if n > 0 then throwAfter (n - 1) else throw "Uh oh!";
| ^ | ^
7| else throw "Uh oh!"; 5| in
… while calling 'throwAfter' … while calling 'throwAfter'
at /pwd/lang/eval-fail-duplicate-traces.nix:4:16: at /pwd/lang/eval-fail-duplicate-traces.nix:4:16:
3| let 3| let
4| throwAfter = n: 4| throwAfter = n: if n > 0 then throwAfter (n - 1) else throw "Uh oh!";
| ^ | ^
5| if n > 0 5| in
… from call site … from call site
at /pwd/lang/eval-fail-duplicate-traces.nix:6:10: at /pwd/lang/eval-fail-duplicate-traces.nix:4:33:
5| if n > 0 3| let
6| then throwAfter (n - 1) 4| throwAfter = n: if n > 0 then throwAfter (n - 1) else throw "Uh oh!";
| ^ | ^
7| else throw "Uh oh!"; 5| in
… while calling 'throwAfter' … while calling 'throwAfter'
at /pwd/lang/eval-fail-duplicate-traces.nix:4:16: at /pwd/lang/eval-fail-duplicate-traces.nix:4:16:
3| let 3| let
4| throwAfter = n: 4| throwAfter = n: if n > 0 then throwAfter (n - 1) else throw "Uh oh!";
| ^ | ^
5| if n > 0 5| in
… while calling the 'throw' builtin … while calling the 'throw' builtin
at /pwd/lang/eval-fail-duplicate-traces.nix:7:10: at /pwd/lang/eval-fail-duplicate-traces.nix:4:57:
6| then throwAfter (n - 1) 3| let
7| else throw "Uh oh!"; 4| throwAfter = n: if n > 0 then throwAfter (n - 1) else throw "Uh oh!";
| ^ | ^
8| in 5| in
error: Uh oh! error: Uh oh!

View file

@ -1,8 +1,8 @@
error: error:
… while calling the 'fetchurl' builtin … while calling the 'fetchurl' builtin
at /pwd/lang/eval-fail-fetchurl-baseName-attrs-name.nix:1:1: at /pwd/lang/eval-fail-fetchurl-baseName-attrs-name.nix:1:1:
1| builtins.fetchurl { url = "https://example.com/foo.tar.gz"; name = "~wobble~"; } 1| builtins.fetchurl {
| ^ | ^
2| 2| url = "https://example.com/foo.tar.gz";
error: invalid store path name when fetching URL 'https://example.com/foo.tar.gz': name '~wobble~' contains illegal character '~'. Please change the value for the 'name' attribute passed to 'fetchurl', so that it can create a valid store path. error: invalid store path name when fetching URL 'https://example.com/foo.tar.gz': name '~wobble~' contains illegal character '~'. Please change the value for the 'name' attribute passed to 'fetchurl', so that it can create a valid store path.

View file

@ -2,36 +2,36 @@ error:
… while calling the 'foldl'' builtin … while calling the 'foldl'' builtin
at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:2:1: at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:2:1:
1| # Tests that the result of applying op is forced even if the value is never used 1| # Tests that the result of applying op is forced even if the value is never used
2| builtins.foldl' 2| builtins.foldl' (_: f: f null) null [
| ^ | ^
3| (_: f: f null) 3| (_: throw "Not the final value, but is still forced!")
… while calling anonymous lambda … while calling anonymous lambda
at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:3:7: at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:2:21:
2| builtins.foldl' 1| # Tests that the result of applying op is forced even if the value is never used
3| (_: f: f null) 2| builtins.foldl' (_: f: f null) null [
| ^ | ^
4| null 3| (_: throw "Not the final value, but is still forced!")
… from call site … from call site
at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:3:10: at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:2:24:
2| builtins.foldl' 1| # Tests that the result of applying op is forced even if the value is never used
3| (_: f: f null) 2| builtins.foldl' (_: f: f null) null [
| ^ | ^
4| null 3| (_: throw "Not the final value, but is still forced!")
… while calling anonymous lambda … while calling anonymous lambda
at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:5:6: at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:3:4:
4| null 2| builtins.foldl' (_: f: f null) null [
5| [ (_: throw "Not the final value, but is still forced!") (_: 23) ] 3| (_: throw "Not the final value, but is still forced!")
| ^ | ^
6| 4| (_: 23)
… while calling the 'throw' builtin … while calling the 'throw' builtin
at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:5:9: at /pwd/lang/eval-fail-foldlStrict-strict-op-application.nix:3:7:
4| null 2| builtins.foldl' (_: f: f null) null [
5| [ (_: throw "Not the final value, but is still forced!") (_: 23) ] 3| (_: throw "Not the final value, but is still forced!")
| ^ | ^
6| 4| (_: 23)
error: Not the final value, but is still forced! error: Not the final value, but is still forced!

View file

@ -1,10 +1,10 @@
error: error:
… while calling the 'toString' builtin … while calling the 'toString' builtin
at /pwd/lang/eval-fail-hashfile-missing.nix:4:3: at /pwd/lang/eval-fail-hashfile-missing.nix:7:1:
3| in 6| in
4| toString (builtins.concatLists (map (hash: map (builtins.hashFile hash) paths) ["md5" "sha1" "sha256" "sha512"])) 7| toString (
| ^ | ^
5| 8| builtins.concatLists (
… while evaluating the first argument passed to builtins.toString … while evaluating the first argument passed to builtins.toString

View file

@ -1,6 +1,6 @@
error: error:
… while evaluating one of the elements to concatenate … while evaluating one of the elements to concatenate
at /pwd/lang/eval-fail-list.nix:1:2: at /pwd/lang/eval-fail-list.nix:1:3:
1| 8 ++ 1 1| 8 ++ 1
| ^ | ^
2| 2|

View file

@ -1,12 +1,13 @@
error: error:
… from call site … from call site
at /pwd/lang/eval-fail-missing-arg.nix:1:1: at /pwd/lang/eval-fail-missing-arg.nix:1:1:
1| ({x, y, z}: x + y + z) {x = "foo"; z = "bar";} 1| (
| ^ | ^
2| 2| {
error: function 'anonymous lambda' called without required argument 'y' error: function 'anonymous lambda' called without required argument 'y'
at /pwd/lang/eval-fail-missing-arg.nix:1:2: at /pwd/lang/eval-fail-missing-arg.nix:2:3:
1| ({x, y, z}: x + y + z) {x = "foo"; z = "bar";} 1| (
2| {
| ^ | ^
2| 3| x,

View file

@ -1,64 +1,64 @@
error: error:
… from call site … from call site
at /pwd/lang/eval-fail-mutual-recursion.nix:36:3: at /pwd/lang/eval-fail-mutual-recursion.nix:40:1:
35| in 39| in
36| throwAfterA true 10 40| throwAfterA true 10
| ^ | ^
37| 41|
… while calling 'throwAfterA' … while calling 'throwAfterA'
at /pwd/lang/eval-fail-mutual-recursion.nix:29:26: at /pwd/lang/eval-fail-mutual-recursion.nix:32:14:
28| 31| throwAfterA =
29| throwAfterA = recurse: n: 32| recurse: n:
| ^ | ^
30| if n > 0 33| if n > 0 then
… from call site … from call site
at /pwd/lang/eval-fail-mutual-recursion.nix:31:10: at /pwd/lang/eval-fail-mutual-recursion.nix:34:7:
30| if n > 0 33| if n > 0 then
31| then throwAfterA recurse (n - 1) 34| throwAfterA recurse (n - 1)
| ^ | ^
32| else if recurse 35| else if recurse then
(19 duplicate frames omitted) (19 duplicate frames omitted)
… from call site … from call site
at /pwd/lang/eval-fail-mutual-recursion.nix:33:10: at /pwd/lang/eval-fail-mutual-recursion.nix:36:7:
32| else if recurse 35| else if recurse then
33| then throwAfterB true 10 36| throwAfterB true 10
| ^ | ^
34| else throw "Uh oh!"; 37| else
… while calling 'throwAfterB' … while calling 'throwAfterB'
at /pwd/lang/eval-fail-mutual-recursion.nix:22:26: at /pwd/lang/eval-fail-mutual-recursion.nix:23:14:
21| let 22| throwAfterB =
22| throwAfterB = recurse: n: 23| recurse: n:
| ^ | ^
23| if n > 0 24| if n > 0 then
… from call site … from call site
at /pwd/lang/eval-fail-mutual-recursion.nix:24:10: at /pwd/lang/eval-fail-mutual-recursion.nix:25:7:
23| if n > 0 24| if n > 0 then
24| then throwAfterB recurse (n - 1) 25| throwAfterB recurse (n - 1)
| ^ | ^
25| else if recurse 26| else if recurse then
(19 duplicate frames omitted) (19 duplicate frames omitted)
… from call site … from call site
at /pwd/lang/eval-fail-mutual-recursion.nix:26:10: at /pwd/lang/eval-fail-mutual-recursion.nix:27:7:
25| else if recurse 26| else if recurse then
26| then throwAfterA false 10 27| throwAfterA false 10
| ^ | ^
27| else throw "Uh oh!"; 28| else
(21 duplicate frames omitted) (21 duplicate frames omitted)
… while calling the 'throw' builtin … while calling the 'throw' builtin
at /pwd/lang/eval-fail-mutual-recursion.nix:34:10: at /pwd/lang/eval-fail-mutual-recursion.nix:38:7:
33| then throwAfterB true 10 37| else
34| else throw "Uh oh!"; 38| throw "Uh oh!";
| ^ | ^
35| in 39| in
error: Uh oh! error: Uh oh!

View file

@ -1,9 +1,9 @@
error: error:
… while evaluating a path segment … while evaluating a path segment
at /pwd/lang/eval-fail-nested-list-items.nix:11:6: at /pwd/lang/eval-fail-nested-list-items.nix:12:3:
10| 11| ""
11| "" + (let v = [ [ 1 2 3 4 5 6 7 8 ] [1 2 3 4]]; in builtins.deepSeq v v) 12| + (
| ^ | ^
12| 13| let
error: cannot coerce a list to a string: [ [ 1 2 3 4 5 6 7 8 ] [ 1 «3 items elided» ] ] error: cannot coerce a list to a string: [ [ 1 2 3 4 5 6 7 8 ] [ 1 «3 items elided» ] ]

View file

@ -1,12 +1,12 @@
error: error:
… in the argument of the not operator … in the argument of the not operator
at /pwd/lang/eval-fail-not-throws.nix:1:4: at /pwd/lang/eval-fail-not-throws.nix:1:3:
1| !(throw "uh oh!") 1| !(throw "uh oh!")
| ^ | ^
2| 2|
… while calling the 'throw' builtin … while calling the 'throw' builtin
at /pwd/lang/eval-fail-not-throws.nix:1:4: at /pwd/lang/eval-fail-not-throws.nix:1:3:
1| !(throw "uh oh!") 1| !(throw "uh oh!")
| ^ | ^
2| 2|

View file

@ -1,12 +1,14 @@
error: error:
… in the right operand of the update (//) operator … in the right operand of the update (//) operator
at /pwd/lang/eval-fail-recursion.nix:1:12: at /pwd/lang/eval-fail-recursion.nix:2:11:
1| let a = {} // a; in a.foo 1| let
2| a = { } // a;
| ^ | ^
2| 3| in
error: infinite recursion encountered error: infinite recursion encountered
at /pwd/lang/eval-fail-recursion.nix:1:15: at /pwd/lang/eval-fail-recursion.nix:2:14:
1| let a = {} // a; in a.foo 1| let
2| a = { } // a;
| ^ | ^
2| 3| in

View file

@ -1,15 +1,15 @@
error: error:
… while evaluating the attribute 'body' … while evaluating the attribute 'body'
at /pwd/lang/eval-fail-remove.nix:4:3: at /pwd/lang/eval-fail-remove.nix:7:3:
3| 6|
4| body = (removeAttrs attrs ["x"]).x; 7| body = (removeAttrs attrs [ "x" ]).x;
| ^ | ^
5| } 8| }
error: attribute 'x' missing error: attribute 'x' missing
at /pwd/lang/eval-fail-remove.nix:4:10: at /pwd/lang/eval-fail-remove.nix:7:10:
3| 6|
4| body = (removeAttrs attrs ["x"]).x; 7| body = (removeAttrs attrs [ "x" ]).x;
| ^ | ^
5| } 8| }
Did you mean y? Did you mean y?

View file

@ -1,28 +1,28 @@
error: error:
… while evaluating the attribute 'body' … while evaluating the attribute 'body'
at /pwd/lang/eval-fail-scope-5.nix:8:3: at /pwd/lang/eval-fail-scope-5.nix:13:3:
7| 12|
8| body = f {}; 13| body = f { };
| ^ | ^
9| 14|
… from call site … from call site
at /pwd/lang/eval-fail-scope-5.nix:8:10: at /pwd/lang/eval-fail-scope-5.nix:13:10:
7| 12|
8| body = f {}; 13| body = f { };
| ^ | ^
9| 14|
… while calling 'f' … while calling 'f'
at /pwd/lang/eval-fail-scope-5.nix:6:7: at /pwd/lang/eval-fail-scope-5.nix:7:5:
5| 6| f =
6| f = {x ? y, y ? x}: x + y; 7| {
| ^ | ^
7| 8| x ? y,
error: infinite recursion encountered error: infinite recursion encountered
at /pwd/lang/eval-fail-scope-5.nix:6:12: at /pwd/lang/eval-fail-scope-5.nix:8:11:
5| 7| {
6| f = {x ? y, y ? x}: x + y; 8| x ? y,
| ^ | ^
7| 9| y ? x,

View file

@ -1,5 +1,5 @@
error: undefined variable 'x' error: undefined variable 'x'
at /pwd/lang/eval-fail-set.nix:1:3: at /pwd/lang/eval-fail-set.nix:1:4:
1| 8. x 1| 8. x
| ^ | ^
2| 2|

View file

@ -1,13 +1,13 @@
error: error:
… from call site … from call site
at /pwd/lang/eval-fail-undeclared-arg.nix:1:1: at /pwd/lang/eval-fail-undeclared-arg.nix:1:1:
1| ({x, z}: x + z) {x = "foo"; y = "bla"; z = "bar";} 1| ({ x, z }: x + z) {
| ^ | ^
2| 2| x = "foo";
error: function 'anonymous lambda' called with unexpected argument 'y' error: function 'anonymous lambda' called with unexpected argument 'y'
at /pwd/lang/eval-fail-undeclared-arg.nix:1:2: at /pwd/lang/eval-fail-undeclared-arg.nix:1:2:
1| ({x, z}: x + z) {x = "foo"; y = "bla"; z = "bar";} 1| ({ x, z }: x + z) {
| ^ | ^
2| 2| x = "foo";
Did you mean one of x or z? Did you mean one of x or z?

View file

@ -1,14 +1,14 @@
error: error:
… while evaluating an attribute name … while evaluating an attribute name
at /pwd/lang/eval-fail-using-set-as-attr-name.nix:5:10: at /pwd/lang/eval-fail-using-set-as-attr-name.nix:7:8:
4| in 6| in
5| attr.${key} 7| attr.${key}
| ^ | ^
6| 8|
error: expected a string but found a set: { } error: expected a string but found a set: { }
at /pwd/lang/eval-fail-using-set-as-attr-name.nix:5:10: at /pwd/lang/eval-fail-using-set-as-attr-name.nix:7:8:
4| in 6| in
5| attr.${key} 7| attr.${key}
| ^ | ^
6| 8|

View file

@ -6,7 +6,8 @@ Added <number omitted> variables.
nix-repl> :doc curriedArgs nix-repl> :doc curriedArgs
Function `curriedArgs`\ Function `curriedArgs`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:48:5 … defined at /path/to/tests/functional/repl/doc-comments.nix:87:5
A documented function. A documented function.
@ -17,7 +18,8 @@ nix-repl> "Note that users may not expect this to behave as it currently does"
nix-repl> :doc x nix-repl> :doc x
Function `curriedArgs`\ Function `curriedArgs`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:50:5 … defined at /path/to/tests/functional/repl/doc-comments.nix:91:5
The function returned by applying once The function returned by applying once

View file

@ -9,6 +9,7 @@ nix-repl> "Note that this is not yet complete"
nix-repl> :doc documentedFormals nix-repl> :doc documentedFormals
Function `documentedFormals`\ Function `documentedFormals`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:57:5 … defined at /path/to/tests/functional/repl/doc-comments.nix:104:5
Finds x Finds x

View file

@ -2,6 +2,7 @@ Nix <nix version>
Type :? for help. Type :? for help.
nix-repl> :doc import ./doc-comment-function.nix nix-repl> :doc import ./doc-comment-function.nix
Function defined at /path/to/tests/functional/repl/doc-comment-function.nix:2:1 Function defined at /path/to/tests/functional/repl/doc-comment-function.nix:4:1
A doc comment for a file that only contains a function A doc comment for a file that only contains a function

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc compact nix-repl> :doc compact
Function `compact`\ Function `compact`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:18:20 … defined at /path/to/tests/functional/repl/doc-comments.nix:27:5
boom boom

View file

@ -10,25 +10,27 @@ error: value does not have documentation
nix-repl> :doc lib.version nix-repl> :doc lib.version
Attribute `version` Attribute `version`
… defined at /path/to/tests/functional/repl/doc-comments.nix:30:3 … defined at /path/to/tests/functional/repl/doc-comments.nix:47:3
Immovably fixed. Immovably fixed.
nix-repl> :doc lib.attr.empty nix-repl> :doc lib.attr.empty
Attribute `empty` Attribute `empty`
… defined at /path/to/tests/functional/repl/doc-comments.nix:33:3 … defined at /path/to/tests/functional/repl/doc-comments.nix:52:3
Unchangeably constant. Unchangeably constant.
nix-repl> :doc lib.attr.undocument nix-repl> :doc lib.attr.undocument
error: error:
… while evaluating the attribute 'attr.undocument' … while evaluating the attribute 'attr.undocument'
at /path/to/tests/functional/repl/doc-comments.nix:33:3: at /path/to/tests/functional/repl/doc-comments.nix:52:3:
32| /** Unchangeably constant. */ 51| */
33| lib.attr.empty = { }; 52| lib.attr.empty = { };
| ^ | ^
34| 53|
error: attribute 'undocument' missing error: attribute 'undocument' missing
at «string»:1:1: at «string»:1:1:
@ -39,28 +41,31 @@ error:
nix-repl> :doc (import ./doc-comments.nix).constant nix-repl> :doc (import ./doc-comments.nix).constant
Attribute `constant` Attribute `constant`
… defined at /path/to/tests/functional/repl/doc-comments.nix:27:3 … defined at /path/to/tests/functional/repl/doc-comments.nix:42:3
Firmly rigid. Firmly rigid.
nix-repl> :doc (import ./doc-comments.nix).lib.version nix-repl> :doc (import ./doc-comments.nix).lib.version
Attribute `version` Attribute `version`
… defined at /path/to/tests/functional/repl/doc-comments.nix:30:3 … defined at /path/to/tests/functional/repl/doc-comments.nix:47:3
Immovably fixed. Immovably fixed.
nix-repl> :doc (import ./doc-comments.nix).lib.attr.empty nix-repl> :doc (import ./doc-comments.nix).lib.attr.empty
Attribute `empty` Attribute `empty`
… defined at /path/to/tests/functional/repl/doc-comments.nix:33:3 … defined at /path/to/tests/functional/repl/doc-comments.nix:52:3
Unchangeably constant. Unchangeably constant.
nix-repl> :doc (import ./doc-comments.nix).lib.attr.undocumented nix-repl> :doc (import ./doc-comments.nix).lib.attr.undocumented
Attribute `undocumented` Attribute `undocumented`
… defined at /path/to/tests/functional/repl/doc-comments.nix:35:3 … defined at /path/to/tests/functional/repl/doc-comments.nix:54:3
No documentation found. No documentation found.
@ -97,11 +102,11 @@ error: attribute 'missing' missing
nix-repl> :doc lib.attr.undocumental nix-repl> :doc lib.attr.undocumental
error: error:
… while evaluating the attribute 'attr.undocumental' … while evaluating the attribute 'attr.undocumental'
at /path/to/tests/functional/repl/doc-comments.nix:33:3: at /path/to/tests/functional/repl/doc-comments.nix:52:3:
32| /** Unchangeably constant. */ 51| */
33| lib.attr.empty = { }; 52| lib.attr.empty = { };
| ^ | ^
34| 53|
error: attribute 'undocumental' missing error: attribute 'undocumental' missing
at «string»:1:1: at «string»:1:1:

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc floatedIn nix-repl> :doc floatedIn
Function `floatedIn`\ Function `floatedIn`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:16:5 … defined at /path/to/tests/functional/repl/doc-comments.nix:21:5
This also works. This also works.

View file

@ -6,24 +6,28 @@ Added <number omitted> variables.
nix-repl> :doc nonStrict nix-repl> :doc nonStrict
Function `nonStrict`\ Function `nonStrict`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:37:70 … defined at /path/to/tests/functional/repl/doc-comments.nix:60:5
My syntax is not strict, but I'm strict anyway. My syntax is not strict, but I'm strict anyway.
nix-repl> :doc strict nix-repl> :doc strict
Function `strict`\ Function `strict`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:38:63 … defined at /path/to/tests/functional/repl/doc-comments.nix:65:5
I don't have to be strict, but I am anyway. I don't have to be strict, but I am anyway.
nix-repl> :doc strictPre nix-repl> :doc strictPre
Function `strictPre`\ Function `strictPre`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:40:48 … defined at /path/to/tests/functional/repl/doc-comments.nix:71:5
Here's one way to do this Here's one way to do this
nix-repl> :doc strictPost nix-repl> :doc strictPost
Function `strictPost`\ Function `strictPost`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:41:53 … defined at /path/to/tests/functional/repl/doc-comments.nix:76:5
Here's another way to do this Here's another way to do this

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc measurement nix-repl> :doc measurement
Function `measurement`\ Function `measurement`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:13:17 … defined at /path/to/tests/functional/repl/doc-comments.nix:15:17
👈 precisely this wide 👉 👈 precisely this wide 👉

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc unambiguous nix-repl> :doc unambiguous
Function `unambiguous`\ Function `unambiguous`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:24:5 … defined at /path/to/tests/functional/repl/doc-comments.nix:37:5
Very close Very close