Sorry, I got my examples mixed up.  I'll try to reconstruct what I was saying.

On 9/1/2020 1:27 PM, Dan Smith wrote:
On Sep 1, 2020, at 8:22 AM, Brian Goetz <brian.go...@oracle.com> wrote:

But, there is a subtle difference between

     switch (x) {
         case FOO: ...
     }

and

     sealed switch (x) {
         case FOO: ....
         default: // nothing
     }

which is, what happens on remainder.  In the former, it is just another ignored 
non-matching input; in the latter, we throw.
Confused here. Doesn't 'default' handle the remainder explicitly? Under what 
conditions does your sealed switch throw?

The way I'm modeling remainder handling in my head is that sealed switches 
without 'default' get an implicit 'default' clause that throws. (And, for that 
matter, regular switches without 'default' get an implicit 'default' that is a 
no-op.)

Reply via email to