Merge pull request #39301 from Calinou/fix-argument-parameter-confusion

Tweak the GDScript error message about passed argument type mismatch
This commit is contained in:
Rémi Verschelde 2020-06-05 11:33:53 +02:00 committed by GitHub
commit 36f6103026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7345,8 +7345,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
} else if (!_is_type_compatible(arg_types[i - arg_diff], par_type, true)) {
// Supertypes are acceptable for dynamic compliance
if (!_is_type_compatible(par_type, arg_types[i - arg_diff])) {
_set_error("At \"" + callee_name + "()\" call, argument " + itos(i - arg_diff + 1) + ". Assigned type (" +
par_type.to_string() + ") doesn't match the function argument's type (" +
_set_error("At \"" + callee_name + "()\" call, argument " + itos(i - arg_diff + 1) + ". The passed argument's type (" +
par_type.to_string() + ") doesn't match the function's expected argument type (" +
arg_types[i - arg_diff].to_string() + ").",
p_call->line);
return DataType();