duplicate arguments in a function handled
This commit is contained in:
parent
0e25f54755
commit
5424b626f9
|
@ -3809,6 +3809,12 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
||||||
}
|
}
|
||||||
|
|
||||||
StringName argname = tokenizer->get_token_identifier();
|
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);
|
arguments.push_back(argname);
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
arguments_usage.push_back(0);
|
arguments_usage.push_back(0);
|
||||||
|
|
Loading…
Reference in New Issue