Disallow delete on types containing nested mappings.

This commit is contained in:
Marenz
2021-09-06 14:17:38 +02:00
parent 359bc09ada
commit d248d35905
11 changed files with 60 additions and 137 deletions
+4
View File
@@ -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())