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.
This commit is contained in:
George Marques 2024-04-11 20:28:46 -03:00
parent 83b916bb00
commit e761982979
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D

View file

@ -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;