diff options
author | George Marques <george@gmarqu.es> | 2023-01-12 11:22:01 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-12 11:22:01 -0300 |
commit | 7319fa60825ec2e530fe843897b350e6012ae461 (patch) | |
tree | 0f8b62452bc3731ca7d828cf5296495d545561bf /modules/gdscript/gdscript_parser.cpp | |
parent | 9943cb624200374ef9f4f51482cc4a39c0651769 (diff) | |
parent | 056066ee95a62291806a908e9fb634533f2222e0 (diff) |
Merge pull request #70713 from vonagam/fix-unnamed-enum-outer-conflicts
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index a6b8537074..bbea6fe857 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -1321,14 +1321,8 @@ GDScriptParser::EnumNode *GDScriptParser::parse_enum() { if (elements.has(item.identifier->name)) { push_error(vformat(R"(Name "%s" was already in this enum (at line %d).)", item.identifier->name, elements[item.identifier->name]), item.identifier); } else if (!named) { - // TODO: Abstract this recursive member check. - ClassNode *parent = current_class; - while (parent != nullptr) { - if (parent->members_indices.has(item.identifier->name)) { - push_error(vformat(R"(Name "%s" is already used as a class %s.)", item.identifier->name, parent->get_member(item.identifier->name).get_type_name())); - break; - } - parent = parent->outer; + if (current_class->members_indices.has(item.identifier->name)) { + push_error(vformat(R"(Name "%s" is already used as a class %s.)", item.identifier->name, current_class->get_member(item.identifier->name).get_type_name())); } } |