From 0cee44838ccae33e2a70e88b805268b2531c552c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 28 Sep 2022 15:08:11 +0300 Subject: feat(tvix/eval): add error kind for unmergeable nested attributes Change-Id: Ic5e6d1bf2625c33938360affb0d1a7c922af11bf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6799 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/errors.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tvix/eval/src/errors.rs') diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index 92ca59f105..1776cef88b 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -95,6 +95,10 @@ pub enum ErrorKind { name: SmolStr, }, + /// Nested attributes can not be merged with values that are not + /// literal attribute sets. + UnmergeableValue, + /// Tvix internal warning for features triggered by users that are /// not actually implemented yet, and without which eval can not /// proceed. @@ -256,6 +260,11 @@ to a missing value in the attribute set(s) included via `with`."#, ) } + ErrorKind::UnmergeableValue => { + "nested attribute sets or keys can only be merged with literal attribute sets" + .into() + } + ErrorKind::NotImplemented(feature) => { format!("feature not yet implemented in Tvix: {}", feature) } @@ -290,6 +299,7 @@ to a missing value in the attribute set(s) included via `with`."#, ErrorKind::NegativeLength { .. } => "E022", ErrorKind::TailEmptyList { .. } => "E023", ErrorKind::UnmergeableInherit { .. } => "E024", + ErrorKind::UnmergeableValue => "E025", ErrorKind::NotImplemented(_) => "E999", } } -- cgit 1.4.1