mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Merge pull request #70713 from vonagam/fix-unnamed-enum-outer-conflicts
This commit is contained in:
commit
7319fa6082
3 changed files with 24 additions and 8 deletions
|
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue