www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23150] New: AA in operator does not work with static if

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

          Issue ID: 23150
           Summary: AA in operator does not work with static if
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: alphaglosined gmail.com

```d
import std.stdio;

void main()
{
    static if(0 in [0: 0]) //This expression should be true.
    {
        writeln(typeof(0 in [0: 0]).stringof);
    }
}
```

Fails with:
onlineapp.d(5): Error: expression `&[0:0][0]` is not constant

Possibly related to https://issues.dlang.org/show_bug.cgi?id=4065

--
May 30 2022