| 241 | } |
| 242 | |
| 243 | static 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 | |
| 262 | GDScriptCodeGenerator::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)) { |
no test coverage detected