浏览代码

Merge pull request #4338 from laytan/fix-ternary-swallow-error

fix not erroring on invalid ternary
gingerBill 1 年之前
父节点
当前提交
9fe8095a84
共有 1 个文件被更改,包括 0 次插入5 次删除
  1. 0 5
      src/check_expr.cpp

+ 0 - 5
src/check_expr.cpp

@@ -8795,11 +8795,6 @@ gb_internal ExprKind check_ternary_if_expr(CheckerContext *c, Operand *o, Ast *n
 		return kind;
 		return kind;
 	}
 	}
 
 
-	if (x.type == nullptr || x.type == t_invalid ||
-	    y.type == nullptr || y.type == t_invalid) {
-		return kind;
-	}
-
 	bool use_type_hint = type_hint != nullptr && (is_operand_nil(x) || is_operand_nil(y));
 	bool use_type_hint = type_hint != nullptr && (is_operand_nil(x) || is_operand_nil(y));
 
 
 	convert_to_typed(c, &x, use_type_hint ? type_hint : y.type);
 	convert_to_typed(c, &x, use_type_hint ? type_hint : y.type);