[Issue 7390] New: Problem in generating switch cases with a static foreach
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jan 28 07:06:13 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7390
Summary: Problem in generating switch cases with a static
foreach
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2012-01-28 07:06:11 PST ---
This seems related to bug 6518
Generating switch cases with a static foreach gives some problems still (DMD
2.058head):
import std.typetuple: TypeTuple;
void main() {
char c;
switch (c) { // OK
case 'z': break;
case 'x': break;
case 'y': break;
default: break;
}
alias TypeTuple!('x', 'y') xy;
switch (c) { // OK
foreach (X; xy) {
case X: break;
}
default: break;
}
switch (c) {
case 'z': break;
foreach (X; xy) {
case X: break;
}
default: break; // Error: switch case fallthrough
}
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list