MCPcopy Create free account
hub / github.com/argotorg/solidity / isValidShiftAndAmountType

Function isValidShiftAndAmountType

libsolidity/ast/Types.cpp:576–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574{
575
576bool isValidShiftAndAmountType(Token _operator, Type const& _shiftAmountType)
577{
578 // Disable >>> here.
579 if (_operator == Token::SHR)
580 return false;
581 else if (IntegerType const* otherInt = dynamic_cast<decltype(otherInt)>(&_shiftAmountType))
582 return !otherInt->isSigned();
583 else if (RationalNumberType const* otherRat = dynamic_cast<decltype(otherRat)>(&_shiftAmountType))
584 return !otherRat->isFractional() && otherRat->integerType() && !otherRat->integerType()->isSigned();
585 else
586 return false;
587}
588
589}
590

Callers 1

binaryOperatorResultMethod · 0.85

Calls 3

isFractionalMethod · 0.80
integerTypeMethod · 0.80
isSignedMethod · 0.45

Tested by

no test coverage detected