Merge pull request #79880 from dalexeev/gds-fix-id-shadowing-below

GDScript: Fix bug with identifier shadowed below in current scope
This commit is contained in:
Yuri Sizov 2023-07-31 21:01:36 +02:00
commit 3de7dd902c
19 changed files with 367 additions and 213 deletions

View file

@ -2280,6 +2280,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_identifier(ExpressionNode
IdentifierNode *identifier = alloc_node<IdentifierNode>();
complete_extents(identifier);
identifier->name = previous.get_identifier();
#ifdef DEBUG_ENABLED
identifier->suite = current_suite;
#endif
if (current_suite != nullptr && current_suite->has_local(identifier->name)) {
const SuiteNode::Local &declaration = current_suite->get_local(identifier->name);