about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-02-01T22·46+0300
committerclbot <clbot@tvl.fyi>2023-02-02T09·29+0000
commit98ea614c6e9ea9428dc10dde630abf894bd01473 (patch)
tree087144129acaaa5e4cf095b01ac199c388dec47a /tvix/eval/src/value
parent90f847ad32b07428832434fa53f0d5d9ffd15994 (diff)
chore(tvix/eval): elaborate on internal types in Value::type_of r/5821
This aids in debugging quite substantially.

Change-Id: Ic43232aa6165ae1c3db7ac2701938e1dfeeb418c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8013
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/mod.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index 0f515109f5c7..e1afe328ddb2 100644
--- a/tvix/eval/src/value/mod.rs
+++ b/tvix/eval/src/value/mod.rs
@@ -319,12 +319,14 @@ impl Value {
             Value::List(_) => "list",
             Value::Closure(_) | Value::Builtin(_) => "lambda",
 
-            // Internal types
-            Value::Thunk(_)
-            | Value::AttrNotFound
-            | Value::Blueprint(_)
-            | Value::DeferredUpvalue(_)
-            | Value::UnresolvedPath(_) => "internal",
+            // Internal types. Note: These are only elaborated here
+            // because it makes debugging easier. If a user ever sees
+            // any of these strings, it's a bug.
+            Value::Thunk(_) => "internal[thunk]",
+            Value::AttrNotFound => "internal[attr_not_found]",
+            Value::Blueprint(_) => "internal[blueprint]",
+            Value::DeferredUpvalue(_) => "internal[deferred_upvalue]",
+            Value::UnresolvedPath(_) => "internal[unresolved_path]",
         }
     }