diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-20 12:43:42 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-20 12:43:42 +0200 |
commit | e83d3060a8efa1465d3498f09347c26cc07a03a7 (patch) | |
tree | 9deb2bdf8873cafd8fb25c40661c5267531ea661 | |
parent | f6bb71fc77fa6cbb0ec870b3e75399027c9a9556 (diff) | |
parent | 7a871212edd7c146331338638f5c9cf4fe7d3fdc (diff) | |
download | redot-engine-e83d3060a8efa1465d3498f09347c26cc07a03a7.tar.gz |
Merge pull request #76259 from kleonc/callable-error-text-expected-arg-count-fix
Fix expected argument count in Callable call error text
-rw-r--r-- | core/variant/variant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index fa3bb78913..10a267e5a9 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -3659,9 +3659,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.argument) + " arguments, but called with " + itos(p_argcount); + err_text = "Method expected " + itos(ce.expected) + " arguments, but called with " + itos(p_argcount); } else if (ce.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { - err_text = "Method expected " + itos(ce.argument) + " arguments, but called with " + itos(p_argcount); + err_text = "Method expected " + itos(ce.expected) + " arguments, 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) { |