mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
parent
15e28fa444
commit
df08d79623
@ -612,10 +612,9 @@ TypeResult IntegerType::unaryOperatorResult(Token _operator) const
|
||||
// "delete" is ok for all integer types
|
||||
if (_operator == Token::Delete)
|
||||
return TypeResult{make_shared<TupleType>()};
|
||||
// we allow +, -, ++ and --
|
||||
else if (_operator == Token::Add || _operator == Token::Sub ||
|
||||
_operator == Token::Inc || _operator == Token::Dec ||
|
||||
_operator == Token::BitNot)
|
||||
// we allow -, ++ and --
|
||||
else if (_operator == Token::Sub || _operator == Token::Inc ||
|
||||
_operator == Token::Dec || _operator == Token::BitNot)
|
||||
return TypeResult{shared_from_this()};
|
||||
else
|
||||
return TypeResult{""};
|
||||
|
@ -6,3 +6,4 @@ contract test {
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (70-72): Use of unary + is disallowed.
|
||||
// TypeError: (70-72): Unary operator + cannot be applied to type uint256
|
||||
|
Loading…
Reference in New Issue
Block a user