Bug 23150 – AA in operator does not work with static if

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-05-31T00:21:43Z
Last change time
2024-12-13T19:23:10Z
Assigned to
No Owner
Creator
Richard (Rikki) Andrew Cattermole
Moved to GitHub: dmd#20114 →

Comments

Comment #0 by alphaglosined — 2022-05-31T00:21:43Z
```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
Comment #1 by destructionator — 2022-05-31T00:30:04Z
Note that ``` static if((0 in [0: 0]) !is null) //This expression should be true. ``` works fine.
Comment #2 by dfj1esp02 — 2022-05-31T10:29:42Z
Not all operators work: static if(!(0 in [0:0])){}
Comment #3 by b2.temp — 2022-05-31T14:27:34Z
> if(!(0 in [0: 0]) !is null){} this one does not work at run-time either
Comment #4 by robert.schadek — 2024-12-13T19:23:10Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20114 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB