mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow unary plus at the parsing stage
This commit is contained in:
@@ -819,16 +819,17 @@ BoolResult FixedPointType::isExplicitlyConvertibleTo(Type const& _convertTo) con
|
||||
|
||||
TypeResult FixedPointType::unaryOperatorResult(Token _operator) const
|
||||
{
|
||||
solAssert(_operator != Token::Add);
|
||||
|
||||
switch (_operator)
|
||||
{
|
||||
case Token::Delete:
|
||||
// "delete" is ok for all fixed types
|
||||
return TypeResult{TypeProvider::emptyTuple()};
|
||||
case Token::Add:
|
||||
case Token::Sub:
|
||||
case Token::Inc:
|
||||
case Token::Dec:
|
||||
// for fixed, we allow +, -, ++ and --
|
||||
// for fixed, we allow -, ++ and --
|
||||
return this;
|
||||
default:
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user