Bug 22442 – Unreachable statements shouldn't count to coverage

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-10-27T23:30:27Z
Last change time
2024-12-13T19:18:55Z
Assigned to
No Owner
Creator
Luís Ferreira
Moved to GitHub: dmd#18061 →

Comments

Comment #0 by contact — 2021-10-27T23:30:27Z
statements after an `assert(0)` shouldn't be marked as coverable by the generated coverage matrix. Similar to `if (0) { ... }` or `if (1) { return; }` or `if (1) { assert(0); }`.
Comment #1 by b2.temp — 2021-10-28T01:49:38Z
I know nobody will like but a simple option is to make "statement not reachable" an error, i.e always.
Comment #2 by robert.schadek — 2024-12-13T19:18:55Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18061 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB