MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _can_use_validate_call

Function _can_use_validate_call

modules/gdscript/gdscript_compiler.cpp:243–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243static bool _can_use_validate_call(const MethodBind *p_method, const Vector<GDScriptCodeGenerator::Address> &p_arguments) {
244 if (p_method->is_vararg()) {
245 // Validated call won't work with vararg methods.
246 return false;
247 }
248 if (p_method->get_argument_count() != p_arguments.size()) {
249 // Validated call won't work with default arguments.
250 return false;
251 }
252 MethodInfo info;
253 ClassDB::get_method_info(p_method->get_instance_class(), p_method->get_name(), &info);
254 for (int64_t i = 0; i < info.arguments.size(); ++i) {
255 if (!_is_exact_type(info.arguments[i], p_arguments[i].type)) {
256 return false;
257 }
258 }
259 return true;
260}
261
262GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &codegen, Error &r_error, const GDScriptParser::ExpressionNode *p_expression, bool p_root, bool p_initializer) {
263 if (p_expression->is_constant && !(p_expression->get_datatype().is_meta_type && p_expression->get_datatype().kind == GDScriptParser::DataType::CLASS)) {

Callers 1

_parse_expressionMethod · 0.85

Calls 5

_is_exact_typeFunction · 0.85
sizeMethod · 0.65
is_varargMethod · 0.45
get_argument_countMethod · 0.45
get_nameMethod · 0.45

Tested by

no test coverage detected