From 4e06e5d2baf99de503decfb3cc92240baf455ee4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 5 Sep 2022 01:35:43 +0300 Subject: fix(tvix/eval): reintroduce 'InvalidAttribuetName' error variant 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 --- tvix/eval/src/value/attrs.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tvix/eval/src/value/attrs.rs') diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index fddf0b582c..b8ae51bf48 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(), + }) + } } } -- cgit 1.4.1