Fix typo in gdscript_parser
This commit is contained in:
parent
d12ee86c22
commit
c3fb5ff359
@ -3413,7 +3413,7 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation)
|
|||||||
Variant::construct(parameter.type, r, &(name), 1, error);
|
Variant::construct(parameter.type, r, &(name), 1, error);
|
||||||
p_annotation->resolved_arguments.push_back(r);
|
p_annotation->resolved_arguments.push_back(r);
|
||||||
if (error.error != Callable::CallError::CALL_OK) {
|
if (error.error != Callable::CallError::CALL_OK) {
|
||||||
push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
push_error(vformat(R"(Expected %s as argument %d of annotation "%s".)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
||||||
p_annotation->resolved_arguments.remove_at(p_annotation->resolved_arguments.size() - 1);
|
p_annotation->resolved_arguments.remove_at(p_annotation->resolved_arguments.size() - 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3422,13 +3422,13 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation)
|
|||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
default: {
|
default: {
|
||||||
if (argument->type != Node::LITERAL) {
|
if (argument->type != Node::LITERAL) {
|
||||||
push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
push_error(vformat(R"(Expected %s as argument %d of annotation "%s".)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant value = static_cast<LiteralNode *>(argument)->value;
|
Variant value = static_cast<LiteralNode *>(argument)->value;
|
||||||
if (!Variant::can_convert_strict(value.get_type(), parameter.type)) {
|
if (!Variant::can_convert_strict(value.get_type(), parameter.type)) {
|
||||||
push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
push_error(vformat(R"(Expected %s as argument %d of annotation "%s".)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Callable::CallError error;
|
Callable::CallError error;
|
||||||
@ -3437,7 +3437,7 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation)
|
|||||||
Variant::construct(parameter.type, r, &(args), 1, error);
|
Variant::construct(parameter.type, r, &(args), 1, error);
|
||||||
p_annotation->resolved_arguments.push_back(r);
|
p_annotation->resolved_arguments.push_back(r);
|
||||||
if (error.error != Callable::CallError::CALL_OK) {
|
if (error.error != Callable::CallError::CALL_OK) {
|
||||||
push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
push_error(vformat(R"(Expected %s as argument %d of annotation "%s".)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
|
||||||
p_annotation->resolved_arguments.remove_at(p_annotation->resolved_arguments.size() - 1);
|
p_annotation->resolved_arguments.remove_at(p_annotation->resolved_arguments.size() - 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user