From c0a7698497fe918eeee036c395059cf0b884f59b Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sun, 21 Sep 2025 14:29:59 +1000 Subject: [PATCH] Ints are autotransformed to doubles where needed --- src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0cd6c0c..49357d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2368,8 +2368,12 @@ Literal exec(vector in, bool executingFunction) { // Type checking - now with error reporting if (arg.type != getLitType(fnArgs[m])) { - return error("Function " + ref.fnName + " argument " + to_string(m + 1) + - " type mismatch. Expected type does not match provided argument type.", "typeError"); + if (arg.type == Types::Double && getLitType(fnArgs[m]) == Types::Int) { + fnArgs[m].val = double(get(fnArgs[m].val)); + } else { + return error("Function " + ref.fnName + " argument " + to_string(m + 1) + + " type mismatch. Expected type does not match provided argument type.", "typeError"); + } } // Create the variable