mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix for not being able to ignore shadowing warnings on class scope
This commit is contained in:
parent
91258e52be
commit
13c73500ab
7 changed files with 41 additions and 48 deletions
|
@ -783,20 +783,6 @@ void GDScriptParser::parse_class_member(T *(GDScriptParser::*p_parse_function)(b
|
|||
|
||||
if (member->identifier != nullptr) {
|
||||
if (!((String)member->identifier->name).is_empty()) { // Enums may be unnamed.
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
List<MethodInfo> gdscript_funcs;
|
||||
GDScriptLanguage::get_singleton()->get_public_functions(&gdscript_funcs);
|
||||
for (MethodInfo &info : gdscript_funcs) {
|
||||
if (info.name == member->identifier->name) {
|
||||
push_warning(member->identifier, GDScriptWarning::SHADOWED_GLOBAL_IDENTIFIER, p_member_kind, member->identifier->name, "built-in function");
|
||||
}
|
||||
}
|
||||
if (Variant::has_utility_function(member->identifier->name)) {
|
||||
push_warning(member->identifier, GDScriptWarning::SHADOWED_GLOBAL_IDENTIFIER, p_member_kind, member->identifier->name, "built-in function");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (current_class->members_indices.has(member->identifier->name)) {
|
||||
push_error(vformat(R"(%s "%s" has the same name as a previously declared %s.)", p_member_kind.capitalize(), member->identifier->name, current_class->get_member(member->identifier->name).get_type_name()), member->identifier);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue