solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Allow delete on user-defined value types

Open chriseth opened this issue 4 years ago • 5 comments

We do not allow any operator on user defined value types, but delete is special: It is implicitly used when we remove an array element and variables of user-defined value type have a default value - so

delete x; // x is of type Type

is essentially equivalent to

Type y;
x = y;

which means we already implicitly use it and it would be confusing to allow re-defining delete to something else.

chriseth avatar Nov 11 '21 15:11 chriseth