mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow delete on types containing nested mappings.
This commit is contained in:
@@ -1449,6 +1449,10 @@ TypeResult ReferenceType::unaryOperatorResult(Token _operator) const
|
||||
{
|
||||
if (_operator != Token::Delete)
|
||||
return nullptr;
|
||||
|
||||
if (containsNestedMapping())
|
||||
return TypeResult::err("Contains a (possibly nested) mapping");
|
||||
|
||||
// delete can be used on everything except calldata references or storage pointers
|
||||
// (storage references are ok)
|
||||
switch (location())
|
||||
|
||||
Reference in New Issue
Block a user