[Issue 23862] New: with statement should accept an expression with enum type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 26 01:50:54 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23862
Issue ID: 23862
Summary: with statement should accept an expression with enum
type
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
enum E { A, B }
void test(E e) {
with (e)
switch (e) {
case A:
case B:
default:
break;
}
}
fails with:
Error: `with` expressions must be aggregate types or pointers to them, not
`E`
This should work.
--
More information about the Digitalmars-d-bugs
mailing list