1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #36704 from ThakeeNathees/gdscript-duplicate-args-fix

GDScript duplicate arguments bug fixed
This commit is contained in:
Rémi Verschelde
2020-03-10 13:10:00 +01:00
committed by GitHub

View File

@@ -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);