diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2023-04-26 17:57:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-26 17:57:45 +0200 |
| commit | ba004ea1c3b00c5516548edde7bdfe2d72d51ea1 (patch) | |
| tree | 534f23706b47017760b8d5e9395b00ef3ebd385a /core | |
| parent | d78691d44fe6e4f38dce3a89164cdae688772031 (diff) | |
| parent | e7f4af091331ef10dd2088d82bc552a097d3d4ce (diff) | |
Merge pull request #76476 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.3) - 3rd batch
Diffstat (limited to 'core')
| -rw-r--r-- | core/variant/variant.cpp | 4 | ||||
| -rw-r--r-- | core/variant/variant_utility.cpp | 1 |
2 files changed, 3 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) { diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp index a6363039ba..fd079dbeea 100644 --- a/core/variant/variant_utility.cpp +++ b/core/variant/variant_utility.cpp @@ -374,6 +374,7 @@ struct VariantUtilityFunctions { r_error.error = Callable::CallError::CALL_OK; if (from.get_type() != to.get_type()) { r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.expected = from.get_type(); r_error.argument = 1; return Variant(); } |