From 286d5ff9437ae798f02cfc5736464e97685e72f7 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sat, 25 Oct 2025 20:07:10 -0700 Subject: [PATCH] slightly better error message --- src/vm.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vm.ts b/src/vm.ts index b116f7d..f451e1e 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -565,7 +565,7 @@ export class VM { } if (fn.type !== 'function') - throw new Error('CALL: not a function') + throw new Error(`CALL: ${fn.type} is not a function (${fn.value})`) if (this.callStack.length > 0) this.callStack[this.callStack.length - 1]!.isBreakTarget = true @@ -657,7 +657,7 @@ export class VM { const tailFn = this.stack.pop()! if (tailFn.type !== 'function') - throw new Error('TAIL_CALL: not a function') + throw new Error(`TAIL_CALL: ${tailFn.type} is not a function (${tailFn.value})`) this.scope = new Scope(tailFn.parentScope)