diff options
author | Vincent Ambo <mail@tazj.in> | 2022-09-04T22·35+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-10T21·57+0000 |
commit | 4e06e5d2baf99de503decfb3cc92240baf455ee4 (patch) | |
tree | 565eeafbfb963bc363d713ad0834c4545e2e8fc4 /tvix/eval/src/value/attrs.rs | |
parent | 06909f182151cf2332a14909e8b772ab4648854e (diff) |
fix(tvix/eval): reintroduce 'InvalidAttribuetName' error variant r/4787
As pointed out by sterni in cl/6205, this is actually possible in syntactically valid expressions like { ${12 + 13} = 12; } Change-Id: Id8a1e3aceb551f288f9050c4eea563eb6572f1a7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6461 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to '')
-rw-r--r-- | tvix/eval/src/value/attrs.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index fddf0b582ccb..b8ae51bf48fc 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -286,7 +286,11 @@ impl NixAttrs { continue; } - other => panic!("unexpected attribute key: {} :: {}", other, other.type_of()), + other => { + return Err(ErrorKind::InvalidAttributeName { + given: other.type_of(), + }) + } } } |