www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14659] New: static if not working with InExpression

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 puremagic.com
          Reporter: dennis.m.ritchie 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

--
Jun 06 2015