Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional set attributes of a function should be included when binding the set #10632

Open
yunfachi opened this issue May 1, 2024 · 0 comments
Labels
feature Feature request or proposal

Comments

@yunfachi
Copy link
Member

yunfachi commented May 1, 2024

Is your feature request related to a problem? Please describe.
When I bind a set with optional attributes, I expect this set to have all required, ignored, specified optional, and unspecified optional attributes, but it only has all required, ignored, and specified optional attributes.

Describe the solution you'd like
When binding a set, unspecified optional attributes should be included.

Describe alternatives you've considered
Creating a new set by inheriting all attributes. For example:
({x, y ? 10}: {inherit x y;}) (x=5;) = { x = 5; y = 10; }

Additional context
In my opinion, they should return the same result, but unspecified attributes are not included

nix-repl> ({x, y ? 10}: {inherit x y;}) {x=5;}
{ x = 5; y = 10; }

nix-repl> ({x, y ? 10} @ args: args) {x=5;} 
{ x = 5; }

Priorities

Add 👍 to issues you find important.

@yunfachi yunfachi added the feature Feature request or proposal label May 1, 2024
@yunfachi yunfachi changed the title Optional set attributes of a function are not binded with the set Optional set attributes of a function should be included when binding the set May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

1 participant