mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
duplicate arguments in a function handled
(cherry picked from commit 5424b626f9
)
This commit is contained in:
parent
5736e43fe4
commit
40b53bc29a
1 changed files with 6 additions and 0 deletions
|
@ -3809,6 +3809,12 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
}
|
||||
|
||||
StringName argname = tokenizer->get_token_identifier();
|
||||
for (int i = 0; i < arguments.size(); i++) {
|
||||
if (arguments[i] == argname) {
|
||||
_set_error("The argument name \"" + String(argname) + "\" is defined multiple times.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
arguments.push_back(argname);
|
||||
#ifdef DEBUG_ENABLED
|
||||
arguments_usage.push_back(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue