Просмотр исходного кода

GDScript: Assume constructor to be accessible from class

Since the constructor is accessed directly from the class, even if not
marked `static`, it can be retrieved as a Callable without an instance.
George Marques 1 год назад
Родитель
Сommit
e761982979
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      modules/gdscript/gdscript_analyzer.cpp

+ 1 - 1
modules/gdscript/gdscript_analyzer.cpp

@@ -3755,7 +3755,7 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod
 				} break;
 
 				case GDScriptParser::ClassNode::Member::FUNCTION: {
-					if (is_base && (!base.is_meta_type || member.function->is_static)) {
+					if (is_base && (!base.is_meta_type || member.function->is_static || is_constructor)) {
 						p_identifier->set_datatype(make_callable_type(member.function->info));
 						p_identifier->source = GDScriptParser::IdentifierNode::MEMBER_FUNCTION;
 						return;