On Sunday, 29 November 2026 at 19:16:44 UTC, Forum User wrote:
One reason D allows them is because of code generation.
Everything that is not forbidden is allowed. It's not forbidden.
But what about warnings on unused variables of non-trivial type:
```
void main() {
size_t a;
Lock b;
a = 1;
}
```
Warnings exist to notify a user that something might go or is
going wrong. There is nothing wrong with unused variables.
Special cases about when a warning triggers is more confusing
than helpful.
Or unused function arguments:
```
void foo (ref size_t a, size_t b) {
a = 1;
}
```
Shall it warn?
No, because you might want them in the future. Unused function
parameters are a way to future proof your API and not break user
code.