1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

property validate assignment condition in new variables, fixes #9411

This commit is contained in:
Juan Linietsky
2017-08-20 16:15:08 -03:00
parent 952db3e676
commit 834112772b

View File

@@ -1931,7 +1931,8 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p
} }
if (!fail) { if (!fail) {
p_func->return_cache = pfunc->return_type; if (r_ret_type)
*r_ret_type = pfunc->return_type;
return true; return true;
} }
} }
@@ -3150,6 +3151,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
assign->op = OP_ASSIGN; assign->op = OP_ASSIGN;
p_block->statements.push_back(assign); p_block->statements.push_back(assign);
tk = _get_token(); tk = _get_token();
if (!_validate_operator(assign)) {
_set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(type) + "'");
return ERR_PARSE_ERROR;
}
} }
if (tk.type == TK_COMMA) { if (tk.type == TK_COMMA) {