auto-calls happen *anywhere* in the value stack where arg names match #11

Open
opened 2024-03-08 12:42:28 +00:00 by pennae · 0 comments
Owner
❯  nix-instantiate -E '{n}: [ n.hello ({n}: n.xz) ]' --arg n 'import <nixpkgs> {}'
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/55c247m6v7f73vs0vwv0q29yqqg6ri3c-hello-2.12.1.drv
/nix/store/cp3vml3b7v4srwq4c45228c64glqvqq2-xz-5.4.6.drv!bin

vs

❯  nix-instantiate -E '{n}: [ n.hello ({a}: a.xz) ]' --arg n 'import <nixpkgs> {}'
error: cannot evaluate a function that has an argument without a value ('a')
       Nix attempted to evaluate a function as a top level expression; in
       this case it must have its arguments supplied either by default
       values, or passed explicitly with '--arg' or '--argstr'. See
       https://nixos.org/manual/nix/stable/language/constructs.html#functions.

       at «string»:1:18:

            1| {n}: [ n.hello ({a}: a.xz) ]
             |                  ^

WHAT

``` ❯ nix-instantiate -E '{n}: [ n.hello ({n}: n.xz) ]' --arg n 'import <nixpkgs> {}' warning: you did not specify '--add-root'; the result might be removed by the garbage collector /nix/store/55c247m6v7f73vs0vwv0q29yqqg6ri3c-hello-2.12.1.drv /nix/store/cp3vml3b7v4srwq4c45228c64glqvqq2-xz-5.4.6.drv!bin ``` vs ``` ❯ nix-instantiate -E '{n}: [ n.hello ({a}: a.xz) ]' --arg n 'import <nixpkgs> {}' error: cannot evaluate a function that has an argument without a value ('a') Nix attempted to evaluate a function as a top level expression; in this case it must have its arguments supplied either by default values, or passed explicitly with '--arg' or '--argstr'. See https://nixos.org/manual/nix/stable/language/constructs.html#functions. at «string»:1:18: 1| {n}: [ n.hello ({a}: a.xz) ] | ^ ``` ***WHAT***
jade added the
ux
label 2024-03-13 18:44:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#11
No description provided.