Treat extlib functions differently

This commit is contained in:
2026-03-14 13:52:42 +11:00
parent cd59281f0c
commit ae17165254

View File

@@ -1815,9 +1815,14 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
if (in->args.args[i + 1].type != VALUE) { if (in->args.args[i + 1].type != VALUE) {
runtimeError(ARG_TYPE_MISMATCH, "Expecting a Value", in, currentInstruction); runtimeError(ARG_TYPE_MISMATCH, "Expecting a Value", in, currentInstruction);
} }
//if (in->args.args[i + 1].value.value.type != function->args[i].type) { if (function->nativeFn) {
if (!checkFnTypes(&in->args.args[i + 1].value.value, &function->args[i])) { if (in->args.args[i + 1].value.value.type != function->args[i].type) {
runtimeError(ARG_TYPE_MISMATCH, "Mismatched function argument types", in, currentInstruction); 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); appendToList(&argsList, in->args.args[i + 1].value.value);
} }