From ae17165254341d50f30ce62d4aa0e817ea6d4c3e Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sat, 14 Mar 2026 13:52:42 +1100 Subject: [PATCH] Treat extlib functions differently --- src/interpreter.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/interpreter.c b/src/interpreter.c index cdc4b01..e9428c0 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -1815,9 +1815,14 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop if (in->args.args[i + 1].type != VALUE) { runtimeError(ARG_TYPE_MISMATCH, "Expecting a Value", in, currentInstruction); } - //if (in->args.args[i + 1].value.value.type != function->args[i].type) { - if (!checkFnTypes(&in->args.args[i + 1].value.value, &function->args[i])) { - runtimeError(ARG_TYPE_MISMATCH, "Mismatched function argument types", in, currentInstruction); + if (function->nativeFn) { + if (in->args.args[i + 1].value.value.type != function->args[i].type) { + runtimeError(ARG_TYPE_MISMATCH, "Mismatched function argument types", in, currentInstruction); + } + } else { + if (!checkFnTypes(&in->args.args[i + 1].value.value, &function->args[i])) { + runtimeError(ARG_TYPE_MISMATCH, "Mismatched function argument types", in, currentInstruction); + } } appendToList(&argsList, in->args.args[i + 1].value.value); }