Merge pull request #34916 from vnen/gdscript-set-lv-assign-type

GDScript: properly set type of local variable initialization
This commit is contained in:
Rémi Verschelde 2020-01-08 17:36:43 +01:00 committed by GitHub
commit bdcfc6d633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8047,6 +8047,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
last_var_assign = lv->assign;
if (lv->assign) {
lv->assign_op->arguments[0]->set_datatype(lv->datatype);
DataType assign_type = _reduce_node_type(lv->assign);
#ifdef DEBUG_ENABLED
if (assign_type.has_type && assign_type.kind == DataType::BUILTIN && assign_type.builtin_type == Variant::NIL) {