Attribute already defined when using function for it's definition
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 17.7k
- Forks
- 2k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 80
Description
I couldn't find this documented anywhere,
although it seems like reasonable compromise in implementation.
nix-repl> {a = ({} // {}); a.b = {};}
error: attribute 'a.b' already defined at (string):1:2
at «string»:1:18:
1| {a = ({} // {}); a.b = {};}
| ^
2|
I find this behavior annoying, especially when using custom functions for configuration like this
{
xdg.configFile = generateTSConfigs [ ... ];
xdg.configFile."nvim/init.lua".source = ...;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the expression in nix-repl and compare the behavior of the function-generated attribute with the nested xdg.configFile assignment. The issue does not name implementation files or tests, so first identify the attribute-definition and merge semantics entry points; done requires an agreed behavior and a regression check for these examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100