From aeea772b1cc73f8f0ec30ad133b6e45fe1b6b0dc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 24 Aug 2022 17:23:23 +0300 Subject: feat(tvix/eval): implement builtins.typeOf Change-Id: Ibc5039b444fadf6f9e5cd9132fcd825a871cee06 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6261 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/builtins/mod.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tvix') diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 594263edb468..ce048e22be0d 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -60,6 +60,9 @@ fn pure_builtins() -> Vec { // 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())) + }), ] } -- cgit 1.4.1