Two sibling let bindings that extend the same variable through dynamic attribute paths are rejected as a redefinition.
$ fix eval --expr 'let x="a"; y="b"; c.${x}=1; c.${y}=2; in c'
error: variable 'c' already defined at 1:29
1 | let x="a"; y="b"; c.${x}=1; c.${y}=2; in c
| ^ near `c`
$ nix-instantiate --eval -E 'let x="a"; y="b"; c.${x}=1; c.${y}=2; in c'
{ a = 1; b = 2; }
Only the both-dynamic case fails. Every static or mixed combination is accepted and correct:
$ fix eval --expr 'let x="a"; c.${x}=1; c.b=2; in c'
{ a = 1; b = 2; }
Hit by pkgs/by-name/lo/local-ai/tests.nix in the pinned nixpkgs.
fix 0.3.0 at 1f1a99cf, built -Doptimize=ReleaseSafe with Zig 0.16.0, darwin/aarch64. Reference implementation is Nix 2.34.8.
Two sibling
letbindings that extend the same variable through dynamic attribute paths are rejected as a redefinition.Only the both-dynamic case fails. Every static or mixed combination is accepted and correct:
Hit by
pkgs/by-name/lo/local-ai/tests.nixin the pinned nixpkgs.fix 0.3.0 at
1f1a99cf, built-Doptimize=ReleaseSafewith Zig 0.16.0, darwin/aarch64. Reference implementation is Nix 2.34.8.