summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_analyzer.cpp
diff options
context:
space:
mode:
authorDanil Alexeev <danil@alexeev.xyz>2023-09-24 23:33:28 +0300
committerDanil Alexeev <danil@alexeev.xyz>2023-10-25 15:53:52 +0300
commitb04263644c3307b8b4a20838cd48f3c19692f1d2 (patch)
treeb9a0791921a176cec29e5859b7fbd288174ddd11 /modules/gdscript/gdscript_analyzer.cpp
parent06d51891678e3abf360d6fcd2e8bd1ba96704fcc (diff)
downloadredot-engine-b04263644c3307b8b4a20838cd48f3c19692f1d2.tar.gz
Core: Allow methods of built-in `Variant` types to be used as Callables
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 983a19470a..5cebe5354b 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -3650,6 +3650,10 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod
return;
}
}
+ if (Variant::has_builtin_method(base.builtin_type, name)) {
+ p_identifier->set_datatype(make_callable_type(Variant::get_builtin_method_info(base.builtin_type, name)));
+ return;
+ }
if (base.is_hard_type()) {
#ifdef SUGGEST_GODOT4_RENAMES
String rename_hint = String();