1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +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:
… while calling the 'addDrvOutputDependencies' builtin
at /pwd/lang/eval-fail-addDrvOutputDependencies-multi-elem-context.nix:18:4:
17|
18| in builtins.addDrvOutputDependencies combo-path
at /pwd/lang/eval-fail-addDrvOutputDependencies-multi-elem-context.nix:25:1:
24| in
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

View file

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

View file

@ -1,8 +1,8 @@
error:
… 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:
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; }'

View file

@ -1,8 +1,8 @@
error:
… 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:
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; }'

View file

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

View file

@ -1,8 +1,8 @@
error:
… while evaluating the condition of the assertion '([ (1) (0) ] == [ (10) ])'
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 ]'

View file

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

View file

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

View file

@ -2,19 +2,19 @@ error:
… while evaluating the attribute 'puppy."${key}"'
at /pwd/lang/eval-fail-attr-name-type.nix:3:5:
2| attrs = {
3| puppy.doggy = {};
3| puppy.doggy = { };
| ^
4| };
… 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
7| attrs.puppy.${key}
| ^
8|
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
7| attrs.puppy.${key}
| ^

View file

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

View file

@ -1,9 +1,9 @@
error:
… while evaluating a path segment
at /pwd/lang/eval-fail-bad-string-interpolation-4.nix:9:3:
8| # The error message should not be too long.
9| ''${pkgs}''
at /pwd/lang/eval-fail-bad-string-interpolation-4.nix:19:3:
18| # The error message should not be too long.
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» }

View file

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

View file

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

View file

@ -1,8 +1,8 @@
error:
… while calling the 'fetchurl' builtin
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.

View file

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

View file

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

View file

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

View file

@ -1,12 +1,13 @@
error:
… from call site
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'
at /pwd/lang/eval-fail-missing-arg.nix:1:2:
1| ({x, y, z}: x + y + z) {x = "foo"; z = "bar";}
at /pwd/lang/eval-fail-missing-arg.nix:2:3:
1| (
2| {
| ^
2|
3| x,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,13 +1,13 @@
error:
… from call site
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'
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?

View file

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

View file

@ -6,7 +6,8 @@ Added <number omitted> variables.
nix-repl> :doc 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.
@ -17,7 +18,8 @@ nix-repl> "Note that users may not expect this to behave as it currently does"
nix-repl> :doc x
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

View file

@ -9,6 +9,7 @@ nix-repl> "Note that this is not yet complete"
nix-repl> :doc 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

View file

@ -2,6 +2,7 @@ Nix <nix version>
Type :? for help.
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

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc 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

View file

@ -10,25 +10,27 @@ error: value does not have documentation
nix-repl> :doc lib.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.
nix-repl> :doc lib.attr.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.
nix-repl> :doc lib.attr.undocument
error:
… while evaluating the attribute 'attr.undocument'
at /path/to/tests/functional/repl/doc-comments.nix:33:3:
32| /** Unchangeably constant. */
33| lib.attr.empty = { };
at /path/to/tests/functional/repl/doc-comments.nix:52:3:
51| */
52| lib.attr.empty = { };
| ^
34|
53|
error: attribute 'undocument' missing
at «string»:1:1:
@ -39,28 +41,31 @@ error:
nix-repl> :doc (import ./doc-comments.nix).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.
nix-repl> :doc (import ./doc-comments.nix).lib.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.
nix-repl> :doc (import ./doc-comments.nix).lib.attr.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.
nix-repl> :doc (import ./doc-comments.nix).lib.attr.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.
@ -97,11 +102,11 @@ error: attribute 'missing' missing
nix-repl> :doc lib.attr.undocumental
error:
… while evaluating the attribute 'attr.undocumental'
at /path/to/tests/functional/repl/doc-comments.nix:33:3:
32| /** Unchangeably constant. */
33| lib.attr.empty = { };
at /path/to/tests/functional/repl/doc-comments.nix:52:3:
51| */
52| lib.attr.empty = { };
| ^
34|
53|
error: attribute 'undocumental' missing
at «string»:1:1:

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc 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.

View file

@ -6,24 +6,28 @@ Added <number omitted> variables.
nix-repl> :doc 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.
nix-repl> :doc 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.
nix-repl> :doc 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
nix-repl> :doc 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

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc 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 👉

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc 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