diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 4155f1ca0b..353c79d6bb 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -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); |