diff options
author | ocean (they/them) <anvilfolk@gmail.com> | 2023-06-21 15:13:45 -0400 |
---|---|---|
committer | ocean (they/them) <anvilfolk@gmail.com> | 2023-06-21 15:13:45 -0400 |
commit | 6c28b8edd3bd43c28c4c5671b4b1800e14b47949 (patch) | |
tree | 0c0e2e551e8659077d76809f08a4ef9ff421d9e3 /modules/gdscript/gdscript_analyzer.cpp | |
parent | 28a60b3de02e8cfcc742a248078e6b7ee8f728b1 (diff) | |
download | redot-engine-6c28b8edd3bd43c28c4c5671b4b1800e14b47949.tar.gz |
GDScript: fix regression when checking for virtual function implementation.
Unfortunately it appears the virtual function checks in #77324 are not
trustworthy at runtime, because objects can have scripts attached, but
this information is not always available at compile-time. These checks
need to be removed.
The rest of the PR is still useful, making all method flags available to
the analyzer, so a full revert isn't necessary/desirable.
This reopens #76938, which will need another solution.
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 9d39cbf1a5..d3445b8cc0 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -3097,16 +3097,6 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a bool is_constructor = (base_type.is_meta_type || (p_call->callee && p_call->callee->type == GDScriptParser::Node::IDENTIFIER)) && p_call->function_name == SNAME("new"); if (get_function_signature(p_call, is_constructor, base_type, p_call->function_name, return_type, par_types, default_arg_count, method_flags)) { - // If the method is implemented in the class hierarchy, the virtual flag will not be set for that MethodInfo and the search stops there. - // MethodInfo's above the class that defines the method might still have the virtual flag set. - if (method_flags.has_flag(METHOD_FLAG_VIRTUAL)) { - if (p_call->is_super) { - push_error(vformat(R"*(Cannot call the parent class' virtual function "%s()" because it hasn't been defined.)*", p_call->function_name), p_call); - } else { - push_error(vformat(R"*(Cannot call virtual function "%s()" because it hasn't been defined.)*", p_call->function_name), p_call); - } - } - // If the function require typed arrays we must make literals be typed. for (const KeyValue<int, GDScriptParser::ArrayNode *> &E : arrays) { int index = E.key; |