Compiler doesn't warn for declared but unused variables

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sun Nov 29 23:54:58 UTC 2026


On 30/11/2026 8:16 AM, Forum User wrote:
> Maybe I misunderstood the question: Isn't DLearner asking for a missed 
> opportunity to flag a potential programmer's mistake and not one of a 
> memory allocation inefficiency?

```d
void foo(bool bar) {
	static if (something)
		if (bar)
			thing();
}
```

That isn't the right idea.


More information about the Digitalmars-d-learn mailing list