Add argument count check for some GDScript functions

- Print functions have no check.
- Also remove extra apostrophe from the error report.
This commit is contained in:
George Marques 2018-01-30 01:32:08 -02:00
parent 9f3138eea9
commit 802d5c4c6c
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
2 changed files with 12 additions and 2 deletions

View file

@ -1518,11 +1518,11 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to
String errwhere;
if (op->arguments[0]->type == Node::TYPE_TYPE) {
TypeNode *tn = static_cast<TypeNode *>(op->arguments[0]);
errwhere = "'" + Variant::get_type_name(tn->vtype) + "'' constructor";
errwhere = "'" + Variant::get_type_name(tn->vtype) + "' constructor";
} else {
GDScriptFunctions::Function func = static_cast<BuiltInFunctionNode *>(op->arguments[0])->function;
errwhere = String("'") + GDScriptFunctions::get_func_name(func) + "'' intrinsic function";
errwhere = String("'") + GDScriptFunctions::get_func_name(func) + "' intrinsic function";
}
switch (ce.error) {