chore(tvix/eval): elaborate on internal types in Value::type_of

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>
This commit is contained in:
Vincent Ambo 2023-02-02 01:46:58 +03:00 committed by clbot
parent 90f847ad32
commit 98ea614c6e

View file

@ -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]",
}
}