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