Merge pull request #43019 from mateosss/3.2

[3.2] Quickfix for misleading editor message when redeclaring variables
This commit is contained in:
Rémi Verschelde 2020-10-23 14:30:02 +02:00 committed by GitHub
commit da9ef8993d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2862,7 +2862,6 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
return; return;
} }
StringName n = tokenizer->get_token_literal(); StringName n = tokenizer->get_token_literal();
tokenizer->advance();
if (current_function) { if (current_function) {
for (int i = 0; i < current_function->arguments.size(); i++) { for (int i = 0; i < current_function->arguments.size(); i++) {
if (n == current_function->arguments[i]) { if (n == current_function->arguments[i]) {
@ -2879,6 +2878,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
} }
check_block = check_block->parent_block; check_block = check_block->parent_block;
} }
tokenizer->advance();
//must know when the local variable is declared //must know when the local variable is declared
LocalVarNode *lv = alloc_node<LocalVarNode>(); LocalVarNode *lv = alloc_node<LocalVarNode>();