1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

GDScript: Fix bug with identifier shadowed below in current scope

This commit is contained in:
Danil Alexeev
2023-07-25 14:21:49 +03:00
parent 202e4b2c1e
commit d53fc92b4c
19 changed files with 367 additions and 213 deletions

View File

@@ -843,19 +843,24 @@ public:
struct IdentifierNode : public ExpressionNode {
StringName name;
#ifdef DEBUG_ENABLED
SuiteNode *suite = nullptr; // The block in which the identifier is used.
#endif
enum Source {
UNDEFINED_SOURCE,
FUNCTION_PARAMETER,
LOCAL_CONSTANT,
LOCAL_VARIABLE,
LOCAL_CONSTANT,
LOCAL_ITERATOR, // `for` loop iterator.
LOCAL_BIND, // Pattern bind.
MEMBER_SIGNAL,
MEMBER_VARIABLE,
STATIC_VARIABLE,
MEMBER_CONSTANT,
MEMBER_FUNCTION,
MEMBER_SIGNAL,
MEMBER_CLASS,
INHERITED_VARIABLE,
STATIC_VARIABLE,
};
Source source = UNDEFINED_SOURCE;