control-semantic/argument-owned-ref.test \
control-semantic/argument-value-out.test \
control-semantic/argument-value-ref.test \
+ control-semantic/condition-not-boolean.test \
+ control-semantic/expression-not-boolean.test \
control-semantic/literal-immutable.test \
control-semantic/member-incompatible-type.test \
control-semantic/member-invalid.test \
left.target_type.nullable = false;
right.target_type.nullable = false;
- value_type = left.target_type.copy ();
+ // Don't falsely resolve to bool
+ if (left.value_type.compatible (context.analyzer.bool_type)
+ && !right.value_type.compatible (context.analyzer.bool_type)) {
+ value_type = right.target_type.copy ();
+ } else {
+ value_type = left.target_type.copy ();
+ }
} else if (operator == BinaryOperator.AND
|| operator == BinaryOperator.OR) {
if (!left.value_type.compatible (context.analyzer.bool_type) || !right.value_type.compatible (context.analyzer.bool_type)) {