[Issue 5714] case ranges in final switches
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Dec 2 06:06:00 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5714
--- Comment #2 from bearophile_hugs at eml.cc 2012-12-02 06:05:59 PST ---
(In reply to comment #1)
> So a final switch would only work on byte-types. I'm not sure if Walter would
> like a feature that only works with one fundamental type.
There are also chars, and ubytes.
> `final switch` currently works on ints (personally I would reject such
> code),
It's indeed wrong, there is another enhancement request/bug report that asks
for it to be fixed!
> As a current workaround you could use a mixin that generates the case
> statements and a 'default' which throws a SwitchError.
You can't have a default in static switches.
--
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