http://d.puremagic.com/issues/show_bug.cgi?id=6285
Summary: switch-case statement fails for enums of strings Product: D Version: D2 Platform: x86_64 OS/Version: Mac OS X Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: blazej.podsia...@gmail.com --- Comment #0 from Blazej Podsiadlo <blazej.podsia...@gmail.com> 2011-07-10 13:59:13 PDT --- Hi, Switch-case statement fails for enums of strings because it is not of integral type. For the following code: enum strEnum : string {strA = "strA", strB = "strB"}; strEnum se = strEnum.strA; switch (strEnum) { case strEnum.strA: break; }; I get the error message: Error: 'strEnum' is not of integral type, it is a strEnum In the same moment, I can workaround that by: string realStr = strEnum.strA; switch (realStr) { case strEnum.strA: break; }; Unfortunately it doesn't help in my case where I want use final switch: final switch (strEnum) { case strEnum.strA: break; case strEnum.strB: break; }; Best Regards Blazej -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------