mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix exponentiation bug
This commit is contained in:
@@ -613,6 +613,13 @@ TypeResult IntegerType::binaryOperatorResult(Token _operator, Type const* _other
|
||||
}
|
||||
else if (dynamic_cast<FixedPointType const*>(_other))
|
||||
return nullptr;
|
||||
else if (auto rationalNumberType = dynamic_cast<RationalNumberType const*>(_other))
|
||||
{
|
||||
if (rationalNumberType->isFractional())
|
||||
return TypeResult::err("Exponent is fractional.");
|
||||
if (!rationalNumberType->integerType())
|
||||
return TypeResult::err("Exponent too large.");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user