Merge pull request #33632 from lupoDharkael/ternary-check

Parser: Check all the arguments of the ternary operator
This commit is contained in:
Rémi Verschelde 2019-11-15 13:31:32 +01:00 committed by GitHub
commit 98caeb635c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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