tvl-depot/tvix/eval/src
sterni d07600dbca fix(tvix/eval/value): correctly emit spaces when coercing lists
r/7176 introduced an incorrect assumption was the benefit of the
nonrecursive coercion algorithm, namely that a coercion operation always
returns a non empty string. This allows to detect whether we are
coercing a list or not by checking if the intermediate result is empty
or not. Unfortunately, coercing null and false yields an empty string,
so we need to explicitly track whether we are coercing a list.

Updated the test case to hopefully catch similar bugs in the future. I'm
not a hundred percent certain I have not introduced a new edge case with
this, so it may be interesting to add a prop test case for this to
nix_oracle down the line. At least lists are the only nested data
structures that can be serialized as nested data structures, so the
problem is kind of limited.

Change-Id: Ia41e904356f1c41a9d35e4e65ec02f2fe5a4100e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10418
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2023-12-25 15:06:23 +00:00
..
builtins fix(tvix/eval): remove incorrect imports when coercing 2023-12-14 13:15:23 +00:00
compiler fix(tvix/eval): add unimplemented __curPos and builtins.filterSource 2023-12-12 17:20:50 +00:00
tests fix(tvix/eval/value): correctly emit spaces when coercing lists 2023-12-25 15:06:23 +00:00
value fix(tvix/eval/value): correctly emit spaces when coercing lists 2023-12-25 15:06:23 +00:00
vm fix(tvix/eval): remove incorrect imports when coercing 2023-12-14 13:15:23 +00:00
chunk.rs docs(tvix/eval): fix some broken docstr references 2023-09-22 09:14:33 +00:00
errors.rs fix(tvix/eval): remove incorrect imports when coercing 2023-12-14 13:15:23 +00:00
io.rs refactor(tvix): use io::Result for EvalIO 2023-12-12 14:28:50 +00:00
lib.rs chore(tvix): add missing clippy attributes & config 2023-11-05 20:28:38 +00:00
nix_search_path.rs fix(tvix/eval): fix b/281 by adding Value::Catchable 2023-09-24 21:54:10 +00:00
observer.rs refactor(tvix/eval/observer): cargo clippy 2023-08-20 21:51:04 +00:00
opcode.rs fix(tvix/eval): remove incorrect imports when coercing 2023-12-14 13:15:23 +00:00
pretty_ast.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
properties.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
source.rs refactor(tvix/eval): impl Default for SourceCode 2023-08-20 21:52:21 +00:00
spans.rs feat(tvix/eval): drop LightSpan::Delayed 2023-12-12 14:34:28 +00:00
systems.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
test_utils.rs test(tvix/eval): Add proof-of-concept test for Chunk 2022-09-18 17:55:06 +00:00
upvalues.rs fix(tvix/eval): remove impl PartialEq for Value 2022-11-04 00:30:13 +00:00
warnings.rs fix(tvix/eval): emit only warnings on shadowed outputs 2023-06-11 20:59:34 +00:00