[Issue 21404] New: Case where dmd emits twice a warning about non-reachable statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 18 23:54:47 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21404

          Issue ID: 21404
           Summary: Case where dmd emits twice a warning about
                    non-reachable statement
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

For the following code, compield with -w

---
module double_warn;

enum E {e}

void main()
{
    E e;
    final switch (e)
        case E.e:
        {
            assert(false);
            break;
        }   
}    
---

The compiler warns:

> double_warn.d(12): Warning: statement is not reachable
> double_warn.d(12): Warning: statement is not reachable

There should be only one.

--


More information about the Digitalmars-d-bugs mailing list