diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 17830394422..ea5e0fd387f 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -823,7 +823,7 @@ Expression::ENode *Expression::_parse_expression() { if (!Variant::is_utility_function_vararg(bifunc->func)) { int expected_args = Variant::get_utility_function_argument_count(bifunc->func); if (expected_args != bifunc->arguments.size()) { - _set_error("Builtin func '" + String(bifunc->func) + "' expects " + itos(expected_args) + " arguments."); + _set_error("Builtin func '" + String(bifunc->func) + "' expects " + itos(expected_args) + " argument(s)."); } } diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 7133e7cd9d6..8cb08417071 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -3501,9 +3501,9 @@ String Variant::get_call_error_text(Object *p_base, const StringName &p_method, err_text = "Cannot convert argument " + itos(errorarg + 1) + " from [missing argptr, type unknown] to " + Variant::get_type_name(Variant::Type(ce.expected)); } } else if (ce.error == Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { - err_text = "Method expected " + itos(ce.expected) + " arguments, but called with " + itos(p_argcount); + err_text = "Method expected " + itos(ce.expected) + " argument(s), but called with " + itos(p_argcount); } else if (ce.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { - err_text = "Method expected " + itos(ce.expected) + " arguments, but called with " + itos(p_argcount); + err_text = "Method expected " + itos(ce.expected) + " argument(s), but called with " + itos(p_argcount); } else if (ce.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) { err_text = "Method not found"; } else if (ce.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) { diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 83bb1cf60c4..25554f5c97f 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -177,7 +177,7 @@ String GDScriptFunction::_get_call_error(const String &p_where, const Variant ** return "Invalid type in " + p_where + ". Cannot convert argument " + itos(p_err.argument + 1) + " from " + Variant::get_type_name(p_argptrs[p_err.argument]->get_type()) + " to " + Variant::get_type_name(Variant::Type(p_err.expected)) + "."; case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: case Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: - return "Invalid call to " + p_where + ". Expected " + itos(p_err.expected) + " arguments."; + return "Invalid call to " + p_where + ". Expected " + itos(p_err.expected) + " argument(s)."; case Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL: return "Attempt to call " + p_where + " on a null instance."; case Callable::CallError::CALL_ERROR_METHOD_NOT_CONST: diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.cs index 1239533a01c..eeb608257e6 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.cs @@ -180,7 +180,7 @@ namespace Godot /// static void Trampoline(object delegateObj, NativeVariantPtrArgs args, out godot_variant ret) /// { /// if (args.Count != 1) - /// throw new ArgumentException($"Callable expected {1} arguments but received {args.Count}."); + /// throw new ArgumentException($"Callable expected {1} argument but received {args.Count}."); /// /// TResult res = ((Func<int, string>)delegateObj)( /// VariantConversionCallbacks.GetToManagedCallback<int>()(args[0]) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.generics.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.generics.cs index 3005582bea4..2dacdabe108 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.generics.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.generics.cs @@ -19,7 +19,7 @@ public readonly partial struct Callable { throw new ArgumentException( "Invalid argument count for invoking callable." + - $" Expected {countExpected} arguments, received {countReceived}.", + $" Expected {countExpected} argument(s), received {countReceived}.", paramName); } } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs index 6b5d7fed784..b91f26a78c3 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs @@ -211,7 +211,7 @@ namespace Godot.NativeInterop } case godot_variant_call_error_error.GODOT_CALL_ERROR_CALL_ERROR_TOO_MANY_ARGUMENTS: case godot_variant_call_error_error.GODOT_CALL_ERROR_CALL_ERROR_TOO_FEW_ARGUMENTS: - return $"Invalid call to {where}. Expected {error.Expected} arguments."; + return $"Invalid call to {where}. Expected {error.Expected} argument(s)."; case godot_variant_call_error_error.GODOT_CALL_ERROR_CALL_ERROR_INVALID_METHOD: return $"Invalid call. Nonexistent {where}."; case godot_variant_call_error_error.GODOT_CALL_ERROR_CALL_ERROR_INSTANCE_IS_NULL: diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 884f4022922..ec7427b4987 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -3578,7 +3578,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, const FunctionI // Stage-based function. const StageFunctionInfo &sf = E.value.stage_functions[name]; if (argcount != sf.arguments.size()) { - _set_error(vformat(RTR("Invalid number of arguments when calling stage function '%s', which expects %d arguments."), String(name), sf.arguments.size())); + _set_error(vformat(RTR("Invalid number of arguments when calling stage function '%s', which expects %d argument(s)."), String(name), sf.arguments.size())); return false; } // Validate arguments.