what happened to the reachability diag ?
Basile B.
b2.temp at gmx.com
Wed Dec 10 15:16:39 UTC 2025
I've been away of D since a while but I'm surprised to see DMD
accepting this input without any **warning**s
```d
module runnable;
void main() nothrow // no landing pad
{
enum E {e0}
E e;
final switch (e)
{
case E.e0: goto case E.e0;
}
return; // statement not reachable
}
void other() nothrow // no landing pad
{
enum E {e0}
E e;
final switch (e)
{
case E.e0: goto case E.e0;
}
int a; // declaration not reachable
}
int shoudlebeLike()
{
assert(0) ;
while (true)
{
other();
}
assert(0);
other();
return 0;
}
```
(tried with -w -wi, etc).
More information about the Digitalmars-d-learn
mailing list