mirror of
https://github.com/godotengine/godot.git
synced 2025-10-26 11:14:17 +00:00
Allow free() to be used as Callable
This method is registered in a special way so ClassDB doesn't naturally know about its existence. Here it is hardcoded if any other option fail to check if it is about the `free()` method and, if so, say it exists and return a Callable.
This commit is contained in:
parent
107f2961cc
commit
b4e08eb752
4 changed files with 22 additions and 1 deletions
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/core_string_names.h"
|
||||
|
||||
bool GDScriptCompiler::_is_class_member_property(CodeGen &codegen, const StringName &p_name) {
|
||||
if (codegen.function_node && codegen.function_node->is_static) {
|
||||
|
|
@ -345,7 +346,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
|
|||
scr = scr->_base;
|
||||
}
|
||||
|
||||
if (nc && (ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
|
||||
if (nc && (identifier == CoreStringNames::get_singleton()->_free || ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
|
||||
// Get like it was a property.
|
||||
GDScriptCodeGenerator::Address temp = codegen.add_temporary(); // TODO: Get type here.
|
||||
GDScriptCodeGenerator::Address self(GDScriptCodeGenerator::Address::SELF);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue