Bool variables should not allow arithmetic comparison

This commit is contained in:
Leonardo Alt
2018-05-16 18:32:47 +02:00
committed by chriseth
parent 9705678269
commit 0b6eea0c55
3 changed files with 2 additions and 35 deletions
+1 -1
View File
@@ -1358,7 +1358,7 @@ TypePointer BoolType::binaryOperatorResult(Token::Value _operator, TypePointer c
{
if (category() != _other->category())
return TypePointer();
if (Token::isCompareOp(_operator) || _operator == Token::And || _operator == Token::Or)
if (_operator == Token::Equal || _operator == Token::NotEqual || _operator == Token::And || _operator == Token::Or)
return _other;
else
return TypePointer();