mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Implements pop() for value type arrays.
This commit is contained in:
@@ -1689,6 +1689,7 @@ MemberList::MemberMap ArrayType::nativeMembers(ContractDefinition const*) const
|
||||
{
|
||||
members.push_back({"length", make_shared<IntegerType>(256)});
|
||||
if (isDynamicallySized() && location() == DataLocation::Storage)
|
||||
{
|
||||
members.push_back({"push", make_shared<FunctionType>(
|
||||
TypePointers{baseType()},
|
||||
TypePointers{make_shared<IntegerType>(256)},
|
||||
@@ -1696,6 +1697,14 @@ MemberList::MemberMap ArrayType::nativeMembers(ContractDefinition const*) const
|
||||
strings{string()},
|
||||
isByteArray() ? FunctionType::Kind::ByteArrayPush : FunctionType::Kind::ArrayPush
|
||||
)});
|
||||
members.push_back({"pop", make_shared<FunctionType>(
|
||||
TypePointers{},
|
||||
TypePointers{},
|
||||
strings{string()},
|
||||
strings{string()},
|
||||
isByteArray() ? FunctionType::Kind::ByteArrayPop : FunctionType::Kind::ArrayPop
|
||||
)});
|
||||
}
|
||||
}
|
||||
return members;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user