feat(tvix/eval): track other type in NotCallable error kind

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>
This commit is contained in:
Vincent Ambo 2022-09-21 01:10:22 +03:00 committed by tazjin
parent 8f2004d360
commit 489395448f
2 changed files with 9 additions and 6 deletions

View file

@ -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()))),
}
}