Bug 14659 – static if not working with associative arrays

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-06T20:55:04Z
Last change time
2024-12-13T18:43:14Z
Assigned to
No Owner
Creator
dennis.m.ritchie
Moved to GitHub: dmd#17712 →

Comments

Comment #0 by dennis.m.ritchie — 2015-06-06T20:55:04Z
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
Comment #1 by dennis.m.ritchie — 2015-06-06T20:56:42Z
Comment #2 by robert.schadek — 2024-12-13T18:43:14Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17712 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB