Commit 54835a53 by Thakee Nathees

shodowed var warning for `for` loop counter

Fix: #39268
parent 2aa46ee4
......@@ -3178,6 +3178,13 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
IdentifierNode *id = alloc_node<IdentifierNode>();
id->name = tokenizer->get_token_identifier();
#ifdef DEBUG_ENABLED
for (int j = 0; j < current_class->variables.size(); j++) {
if (current_class->variables[j].identifier == id->name) {
_add_warning(GDScriptWarning::SHADOWED_VARIABLE, id->line, id->name, itos(current_class->variables[j].line));
}
}
#endif // DEBUG_ENABLED
tokenizer->advance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment