Bug 15279 – increase 256 switch case range limit

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-11-02T23:20:04Z
Last change time
2024-12-13T18:45:38Z
Assigned to
No Owner
Creator
Ali Cehreli
Moved to GitHub: dmd#19066 →

Comments

Comment #0 by acehreli — 2015-11-02T23:20:04Z
void main() { dchar d; switch (d) { case '\u0000': .. case '\u0101': break; } } Error: had 257 cases which is more than 256 cases in case range Same problem with wchar... Ali
Comment #1 by ag0aep6g — 2015-11-02T23:26:45Z
I don't think this is an issue with dchar/char. The same happens with int: ---- void main() { int d; switch (d) { case 0: .. case 0x0101: break; } } ---- Looks like more than 256 cases are not supported.
Comment #2 by dkorpel — 2021-09-08T15:49:16Z
You're hitting a limit that was set in place because the current implementation doesn't scale well to larger ranges, see: https://github.com/dlang/dmd/pull/12002
Comment #3 by robert.schadek — 2024-12-13T18:45:38Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19066 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB