[Issue 14659] New: static if not working with InExpression

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jun 6 13:55:04 PDT 2015


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

          Issue ID: 14659
           Summary: static if not working with InExpression
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: dennis.m.ritchie at mail.ru

I think that `static if` must support `InExpression`:

immutable hash = [1 : 3, 5 : 7];

static if (5 in hash)
    writeln("OK");
// Error: expression &[1:3, 5:7][5]
// is not constant or does not evaluate to a bool

--


More information about the Digitalmars-d-bugs mailing list