diff options
author | Thakee Nathees <thakeenathees@gmail.com> | 2020-03-01 20:39:17 +0530 |
---|---|---|
committer | Thakee Nathees <thakeenathees@gmail.com> | 2020-03-06 20:23:58 +0530 |
commit | 5424b626f96c0fb9e00610036236e3e6c67eda55 (patch) | |
tree | e5463508bd09ab5af53d4e952205a7b7c7c83d72 /modules/gdscript | |
parent | 0e25f54755a5e37fe64e328b7cd3ce4058245f09 (diff) |
duplicate arguments in a function handled
Diffstat (limited to 'modules/gdscript')
-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 0382944efd..0dd56da869 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); |