April 26, 2023
https://issues.dlang.org/show_bug.cgi?id=23862

          Issue ID: 23862
           Summary: with statement should accept an expression with enum
                    type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: bugzilla@digitalmars.com

enum E { A, B }

  void test(E e) {
    with (e)
    switch (e) {
        case A:
        case B:
        default:
            break;
    }
  }

fails with:

  Error: `with` expressions must be aggregate types or pointers to them, not
`E`

This should work.

--