about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/compiler/bindings.rs5
-rw-r--r--tvix/eval/src/errors.rs10
2 files changed, 14 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs
index 5fa08210fd46..53344d067771 100644
--- a/tvix/eval/src/compiler/bindings.rs
+++ b/tvix/eval/src/compiler/bindings.rs
@@ -48,7 +48,10 @@ impl Binding {
                 Some(ErrorKind::UnmergeableInherit { name: name.clone() })
             }
 
-            Binding::Plain { .. } => todo!(),
+            Binding::Plain { expr } => match expr {
+                ast::Expr::AttrSet(_) => todo!(),
+                _ => Some(ErrorKind::UnmergeableValue),
+            },
         }
     }
 }
diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs
index 92ca59f105a4..1776cef88b00 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",
         }
     }