-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11294 from rhendric/rhendric/fix-11268
parser-state: fix attribute merging
- Loading branch information
Showing
8 changed files
with
133 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
tests/functional/lang/eval-fail-attrset-merge-drops-later-rec.err.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
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 | ||
| ^ | ||
2| |
1 change: 1 addition & 0 deletions
1
tests/functional/lang/eval-fail-attrset-merge-drops-later-rec.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ a.b = 1; a = rec { c = d + 2; d = 3; }; }.c |
1 change: 1 addition & 0 deletions
1
tests/functional/lang/eval-okay-regrettable-rec-attrset-merge.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6 |
3 changes: 3 additions & 0 deletions
3
tests/functional/lang/eval-okay-regrettable-rec-attrset-merge.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This is for backwards compatibility, not because we like it. | ||
# See https://github.com/NixOS/nix/issues/9020. | ||
{ a = rec { b = c + 1; d = 2; }; a.c = d + 3; }.a.b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
error: attribute 'z' already defined at «stdin»:3:16 | ||
at «stdin»:2:3: | ||
1| { | ||
error: attribute 'x.z' already defined at «stdin»:2:3 | ||
at «stdin»:3:16: | ||
2| x.z = 3; | ||
| ^ | ||
3| x = { y = 3; z = 3; }; | ||
| ^ | ||
4| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
error: attribute 'y' already defined at «stdin»:3:9 | ||
at «stdin»:2:3: | ||
1| { | ||
error: attribute 'x.y.y' already defined at «stdin»:2:3 | ||
at «stdin»:3:9: | ||
2| x.y.y = 3; | ||
| ^ | ||
3| x = { y.y= 3; z = 3; }; | ||
| ^ | ||
4| } |