feat(tvix/eval): implement builtins.typeOf

Change-Id: Ibc5039b444fadf6f9e5cd9132fcd825a871cee06
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6261
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-08-24 17:23:23 +03:00 committed by tazjin
parent 5b98ece96b
commit aeea772b1c

View file

@ -60,6 +60,9 @@ fn pure_builtins() -> Vec<Builtin> {
// TODO: toString is actually not the same as Display
Ok(Value::String(format!("{}", args[0]).into()))
}),
Builtin::new("typeOf", 1, |args| {
Ok(Value::String(args[0].type_of().into()))
}),
]
}