diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-02 18:05:05 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-02 18:05:05 +0100 |
commit | b5c6e870e8efa466390015c8bc6d88a4dcc9b102 (patch) | |
tree | 7a7b4bfb737ae3c36527bc57d88ddaf936d15247 /modules/gdscript/gdscript_analyzer.cpp | |
parent | 06bb9f28e740aa005b9d48643becfefa5156487d (diff) | |
parent | b04263644c3307b8b4a20838cd48f3c19692f1d2 (diff) | |
download | redot-engine-b5c6e870e8efa466390015c8bc6d88a4dcc9b102.tar.gz |
Merge pull request #82264 from dalexeev/core-builtin-methods-as-callables
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.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 5478a46bbc..cf537bde16 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -3658,6 +3658,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(); |