We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
Attempting to call toString on a list containing a set will produce the very confusing error:
toString
cannot coerce a set to a string
or a list containing a function:
cannot coerce a function to a string
This can take a long time to figure out the first time it happens, given that the error focuses on the list, rather than the element in question.
To Reproduce Steps to reproduce the behavior:
nix eval --expr 'toString [ (x: x) ]'
nix eval --expr 'toString [ {} ]'
Expected behavior A more helpful error, such as
cannot coerce a list to a string because of one of its elements: cannot coerce a set to a string
Metadata
"x86_64-linux"
Linux 5.7.16, NixOS, 20.09.20200820.c59ea8b (Nightingale)
yes
nix-env (Nix) 2.4pre20200721_ff314f1
"nixos-20.03.2806.cb1996818ed"
"home-manager, nixpkgs-20.09pre238994.078b9f8aa68, nixos-19.09-19.09.2284.bf7c0f0461e"
/home/ludvig/.nix-defexpr/channels/nixpkgs
The text was updated successfully, but these errors were encountered:
this should probably be made in https://github.com/NixOS/nix as it relates to the nix cli, and not the nixpkgs package set
Sorry, something went wrong.
Good point.
Opened at NixOS/nix#4000 instead.
No branches or pull requests
Describe the bug
Attempting to call
toString
on a list containing a set will produce the very confusing error:or a list containing a function:
This can take a long time to figure out the first time it happens, given that the error focuses on the list, rather than the element in question.
To Reproduce
Steps to reproduce the behavior:
nix eval --expr 'toString [ (x: x) ]'
ornix eval --expr 'toString [ {} ]'
Expected behavior
A more helpful error, such as
Metadata
"x86_64-linux"
Linux 5.7.16, NixOS, 20.09.20200820.c59ea8b (Nightingale)
yes
yes
nix-env (Nix) 2.4pre20200721_ff314f1
"nixos-20.03.2806.cb1996818ed"
"home-manager, nixpkgs-20.09pre238994.078b9f8aa68, nixos-19.09-19.09.2284.bf7c0f0461e"
/home/ludvig/.nix-defexpr/channels/nixpkgs
The text was updated successfully, but these errors were encountered: