Fix -any again

This commit is contained in:
2026-04-11 19:52:24 +10:00
parent 8a3093c30f
commit ead5cdc299

View File

@@ -1900,7 +1900,7 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
runtimeError(ARG_TYPE_MISMATCH, "Expecting a Value", in, currentInstruction); runtimeError(ARG_TYPE_MISMATCH, "Expecting a Value", in, currentInstruction);
} }
if (function->nativeFn) { if (function->nativeFn) {
if (function->args[i].type != ANY || in->args.args[i + 1].value.value.type != function->args[i].type) { if (function->args[i].type != ANY && 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 { } else {
@@ -2004,7 +2004,7 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
runtimeError(ARG_TYPE_MISMATCH, "Expecting a Value", in, currentInstruction); runtimeError(ARG_TYPE_MISMATCH, "Expecting a Value", in, currentInstruction);
} }
if (function->nativeFn) { if (function->nativeFn) {
if (function->args[i].type != ANY || in->args.args[i + 2].value.value.type != function->args[i].type) { if (function->args[i].type != ANY && in->args.args[i + 2].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 { } else {