summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-08 17:36:43 +0100
committerGitHub <noreply@github.com>2020-01-08 17:36:43 +0100
commitbdcfc6d633825e594471f118bafa46446b3e4930 (patch)
tree666b67242c66f4490e624a04b409a1de7240cb4e /modules/gdscript
parent7a941b11d20d736ec1007140ffd4019fcdfab27f (diff)
parent899f7999b4cdc0ed52cc9961ad4340f8b86596c8 (diff)
Merge pull request #34916 from vnen/gdscript-set-lv-assign-type
GDScript: properly set type of local variable initialization
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_parser.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 112569a8d6..4a28114a7d 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -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) {