about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-08T14·27+0300
committertazjin <tazjin@tvl.su>2022-08-13T11·50+0000
commit2ed38a7cdbd248deb518afff790977243f169a8f (patch)
tree00aab465bde13cde5eed4c82df439be6288b08c6 /tvix/eval/src/vm.rs
parentba03226e514b9bc55e5da35830d5fe6cadcf988c (diff)
feat(tvix/eval): add Value variants for strings & attrsets r/4423
Change-Id: Idebf663ab7fde3955aae50f635320f7eb6c353e8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6087
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 6841ac4706b3..9a718500b5f1 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -36,7 +36,7 @@ impl VM {
 
             (Value::Float(f1), Value::Integer(i2)) => Ok(NumberPair::Floats(f1, i2 as f64)),
 
-            _ => Err(Error::TypeError {
+            (v1, v2) => Err(Error::TypeError {
                 expected: "number (either int or float)",
                 actual: if v1.is_number() {
                     v2.type_of()
@@ -105,7 +105,7 @@ impl VM {
                         (Value::Float(f), Value::Integer(i))
                         | (Value::Integer(i), Value::Float(f)) => f == (i as f64),
 
-                        _ => v2 == v2,
+                        (v1, v2) => v1 == v2,
                     };
 
                     self.push(Value::Bool(eq))