feat(tvix/eval): add Value variants for strings & attrsets

Change-Id: Idebf663ab7fde3955aae50f635320f7eb6c353e8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6087
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-08 17:27:16 +03:00 committed by tazjin
parent ba03226e51
commit 2ed38a7cdb
4 changed files with 21 additions and 6 deletions

View file

@ -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))