Stewart Gordon <> changed:

           What    |Removed                     |Added
           Keywords|                            |spec, wrong-code
                 CC|                            |

--- Comment #1 from Stewart Gordon <> 2011-03-07 05:39:56 PST ---
At first I thought maybe it was ignoring the error out of knowledge that x % 3
== 1 in this instance.  But no - it still accepts (and runs without even a
SwitchError) if I change x to 101.

But you'd need to cover -1 and -2 as well for this to make sense.

The spec doesn't actually disallow it:

"A final switch statement is just like a switch statement, except that:

    * No DefaultStatement is allowed.
    * No CaseRangeStatements are allowed.
    * If the switch Expression is of enum type, all the enum members must
appear in the CaseStatements.
    * The case expressions cannot evaluate to a run time initialized value."

But this seems to be a mistake, and that no SwitchError is thrown strikes me as
a bug.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to