about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-24T14·23+0300
committertazjin <tazjin@tvl.su>2022-09-02T12·59+0000
commitaeea772b1cc73f8f0ec30ad133b6e45fe1b6b0dc (patch)
tree9b5a8d0d03445d2eaf9290d201e3951f75f8db4f /tvix/eval/src
parent5b98ece96b86f87723747d4b750a6aa64663cd90 (diff)
feat(tvix/eval): implement builtins.typeOf r/4595
Change-Id: Ibc5039b444fadf6f9e5cd9132fcd825a871cee06
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6261
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/builtins/mod.rs3
1 files changed, 3 insertions, 0 deletions
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<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()))
+        }),
     ]
 }