Allow delete on user-defined value types
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
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.
Contributor guide
Research direction
Start by tracing the compiler handling for operators on user-defined value types and the existing implicit delete behavior when array elements are removed. Confirm the relevant language-semantics and compiler tests, then verify that delete is accepted for these types without becoming redefinable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100