about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-20T22·10+0300
committertazjin <tazjin@tvl.su>2022-09-20T23·48+0000
commit489395448f0fbe268c6503018012992e1e6cfc22 (patch)
tree4e08eb86c77b63e7a0b49f47ee820a3d29876e86 /tvix/eval/src/vm.rs
parent8f2004d360dde108f90d2b49b0609bd43b7b6d7d (diff)
feat(tvix/eval): track other type in NotCallable error kind r/4944
This makes for slightly nicer error messages if something isn't, well,
callable.

Change-Id: I821c8d7447b93aea9ccaaa52ed329de0cca4b18e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6718
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 69ffc7d5c293..87adfe5611a4 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -193,7 +193,7 @@ impl<'o> VM<'o> {
             Value::Thunk(t) => self.call_value(&t.value()),
 
             // TODO: this isn't guaranteed to be a useful span, actually
-            _ => Err(self.error(ErrorKind::NotCallable)),
+            other => Err(self.error(ErrorKind::NotCallable(other.type_of()))),
         }
     }
 
@@ -499,7 +499,7 @@ impl<'o> VM<'o> {
                             frame.ip = CodeIdx(0); // reset instruction pointer to beginning
                         }
 
-                        _ => return Err(self.error(ErrorKind::NotCallable)),
+                        _ => return Err(self.error(ErrorKind::NotCallable(callable.type_of()))),
                     }
                 }