浏览代码

Merge pull request #33632 from lupoDharkael/ternary-check

Parser: Check all the arguments of the ternary operator
Rémi Verschelde 5 年之前
父节点
当前提交
98caeb635c
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      modules/gdscript/gdscript_parser.cpp

+ 2 - 0
modules/gdscript/gdscript_parser.cpp

@@ -6466,6 +6466,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
 
 					DataType true_type = _reduce_node_type(op->arguments[1]);
 					DataType false_type = _reduce_node_type(op->arguments[2]);
+					// Check arguments[0] errors.
+					_reduce_node_type(op->arguments[0]);
 
 					// If types are equal, then the expression is of the same type
 					// If they are compatible, return the broader type