Comment #0 by timothee.cour2 — 2017-02-10T06:28:44Z
D20170209T222632
dmd -c -o- -w test.d:
```
void test(){
version(linux) return;
int a=1;
int b=1;
}
```
test.d(1): Warning: statement is not reachable
test.d(2): Warning: statement is not reachable
Expected:
test.d(1): Warning: statement is not reachable
The 2nd warning is in the same code block so is redundant. This is annoying:
* when debugging and doing an early return as shown, it can show tons of warnings (masking more useful ones)
* the workaround is to use:
version(none){
// unused code
}
but it has issues:
- increases indentation
- the code is no longer checked for being compilable, and after a while becomes out of sync.
Comment #1 by robert.schadek — 2024-12-13T18:51:35Z