summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2024-04-11 20:28:46 -0300
committerGeorge Marques <george@gmarqu.es>2024-04-11 20:28:46 -0300
commite761982979fa3953ce7dd28c2337e7ae81ca5630 (patch)
tree25809f621c3b13cd06a40ae7b67099367e709295
parent83b916bb00eb8cac4584143a80f5cfad7ce1e908 (diff)
downloadredot-engine-e761982979fa3953ce7dd28c2337e7ae81ca5630.tar.gz
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.
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index a30a87f3a1..3675a4beeb 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/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;