mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
parent
666062cf07
commit
ab33328d1f
1
Token.h
1
Token.h
@ -366,6 +366,7 @@ public:
|
||||
}
|
||||
|
||||
static bool isBitOp(Value op) { return (BitOr <= op && op <= SHR) || op == BitNot; }
|
||||
static bool isBooleanOp(Value op) { return (Or <= op && op <= And) || op == Not; }
|
||||
static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub || op == After; }
|
||||
static bool isCountOp(Value op) { return op == Inc || op == Dec; }
|
||||
static bool isShiftOp(Value op) { return (SHL <= op) && (op <= SHR); }
|
||||
|
@ -311,6 +311,8 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
|
||||
// All integer types can be compared
|
||||
if (Token::isCompareOp(_operator))
|
||||
return commonType;
|
||||
if (Token::isBooleanOp(_operator))
|
||||
return TypePointer();
|
||||
// Nothing else can be done with addresses
|
||||
if (commonType->isAddress())
|
||||
return TypePointer();
|
||||
|
Loading…
Reference in New Issue
Block a user