Browse Source

Clarified binary operator checking for integer types.

cl-refactor
Christian 10 years ago
parent
commit
f37ff5ff4f
  1. 14
      libsolidity/Types.cpp

14
libsolidity/Types.cpp

@ -201,16 +201,16 @@ TypePointer IntegerType::binaryOperatorResultImpl(Token::Value _operator, TypePo
if (!commonType)
return TypePointer();
// All integer types can be compared
if (Token::isCompareOp(_operator))
return commonType;
// Nothing else can be done with addresses, but hashes can receive bit operators
if (commonType->isAddress())
{
if (!Token::isCompareOp(_operator))
return TypePointer();
}
else if (commonType->isHash())
{
if (!(Token::isCompareOp(_operator) || Token::isBitOp(_operator)))
else if (commonType->isHash() && !Token::isBitOp(_operator))
return TypePointer();
}
else
return commonType;
}

Loading…
Cancel
Save