Merge pull request #3775 from federicobond/improve-error-fractional-shift

Improve error message when attempting to shift by fractional number
This commit is contained in:
chriseth
2018-03-28 11:16:44 +02:00
committed by GitHub
3 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -327,7 +327,7 @@ bool isValidShiftAndAmountType(Token::Value _operator, Type const& _shiftAmountT
else if (IntegerType const* otherInt = dynamic_cast<decltype(otherInt)>(&_shiftAmountType))
return !otherInt->isAddress();
else if (RationalNumberType const* otherRat = dynamic_cast<decltype(otherRat)>(&_shiftAmountType))
return otherRat->integerType() && !otherRat->integerType()->isSigned();
return !otherRat->isFractional() && otherRat->integerType() && !otherRat->integerType()->isSigned();
else
return false;
}