diff options
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r-- | tvix/eval/src/vm.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index 58ef67cb5531..0c8ea4ffd1f6 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -211,8 +211,12 @@ impl VM { for _ in 0..count { let value = self.pop(); let key = self.pop().as_string()?; // TODO(tazjin): attrpath - attrs.insert(key, value); + + if attrs.insert(key.clone(), value).is_some() { + return Err(Error::DuplicateAttrsKey { key: key.0 }); + } } + // TODO(tazjin): extend_reserve(count) (rust#72631) self.push(Value::Attrs(Rc::new(NixAttrs::Map(attrs)))); |