[Issue 23635] New: Nonsensical "`case` must be a `string` or an integral constant, not `x`"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jan 16 13:50:26 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23635
Issue ID: 23635
Summary: Nonsensical "`case` must be a `string` or an integral
constant, not `x`"
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P4
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dkorpel at live.nl
```
void main()
{
immutable string x, y;
switch (y) {
case x: break;
default: break;
}
}
```
> onlineapp.d(6): Error: `case` must be a `string` or an integral constant, not `x`
x is a string in this case, so the error is nonsensical.
--
More information about the Digitalmars-d-bugs
mailing list