mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add type().min/max for enums
This commit is contained in:
@@ -1284,8 +1284,10 @@ bool SMTEncoder::visit(MemberAccess const& _memberAccess)
|
||||
auto const& memberName = _memberAccess.memberName();
|
||||
if (memberName == "min" || memberName == "max")
|
||||
{
|
||||
IntegerType const& integerType = dynamic_cast<IntegerType const&>(*magicType->typeArgument());
|
||||
defineExpr(_memberAccess, memberName == "min" ? integerType.minValue() : integerType.maxValue());
|
||||
if (IntegerType const* integerType = dynamic_cast<IntegerType const*>(magicType->typeArgument()))
|
||||
defineExpr(_memberAccess, memberName == "min" ? integerType->minValue() : integerType->maxValue());
|
||||
else if (EnumType const* enumType = dynamic_cast<EnumType const*>(magicType->typeArgument()))
|
||||
defineExpr(_memberAccess, memberName == "min" ? enumType->minValue() : enumType->maxValue());
|
||||
}
|
||||
else if (memberName == "interfaceId")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user