Merge pull request #82264 from dalexeev/core-builtin-methods-as-callables

Core: Allow methods of built-in `Variant` types to be used as Callables
This commit is contained in:
Rémi Verschelde 2024-01-02 18:05:05 +01:00
commit b5c6e870e8
No known key found for this signature in database
GPG key ID: C3336907360768E1
9 changed files with 231 additions and 73 deletions

View file

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