Print value on type error
Adds the failing value to `value is <TYPE> while a <TYPE> is expected` error messages.
This commit is contained in:
@@ -14,7 +14,7 @@ nix --experimental-features 'nix-command' eval --impure --expr \
|
||||
# resolve first. Adding a test so we don't liberalise it by accident.
|
||||
expectStderr 1 nix --experimental-features 'nix-command dynamic-derivations' eval --impure --expr \
|
||||
'builtins.outputOf (import ../dependencies.nix {}) "out"' \
|
||||
| grepQuiet "value is a set while a string was expected"
|
||||
| grepQuiet "expected a string but found a set"
|
||||
|
||||
# Test that "DrvDeep" string contexts are not supported at this time
|
||||
#
|
||||
|
||||
@@ -13,4 +13,4 @@ error:
|
||||
| ^
|
||||
8|
|
||||
|
||||
error: value is an integer while a string was expected
|
||||
error: expected a string but found an integer: 1
|
||||
|
||||
@@ -7,4 +7,4 @@ error:
|
||||
|
||||
… while evaluating the first argument passed to builtins.length
|
||||
|
||||
error: value is an integer while a list was expected
|
||||
error: expected a list but found an integer: 1
|
||||
|
||||
@@ -5,4 +5,4 @@ error:
|
||||
| ^
|
||||
2|
|
||||
|
||||
error: value is an integer while a list was expected
|
||||
error: expected a list but found an integer: 8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
error:
|
||||
… while evaluating the `__overrides` attribute
|
||||
|
||||
error: value is an integer while a set was expected
|
||||
error: expected a set but found an integer: 1
|
||||
|
||||
@@ -6,4 +6,4 @@ error:
|
||||
| ^
|
||||
6|
|
||||
|
||||
error: value is a set while a string was expected
|
||||
error: expected a string but found a set: { }
|
||||
|
||||
Reference in New Issue
Block a user