Switch expression fall through

Ali Ebrahimi ali.ebrahimi1781 at gmail.com
Wed Mar 14 08:00:08 UTC 2018

I fully support current proposal, since for java users that doesn't add
breaking and surprising rules. We can't change java's old rules.

On Wed, Mar 14, 2018 at 4:46 AM, Brian Goetz <brian.goetz at oracle.com> wrote:

> Expression switches and statement switches are the same construct.  There
> are some mild differences around the edges (i.e., one returns a value, the
> other does not), but they are one construct.  I get that you hate fall
> through, but we can’t rid ourselves of fall through (we’ll still have
> switch statements), and having two subtly different switch constructs is
> even worse.  Java’s switch construct, for better or worse, has fall through.
> (And, by the way, there’s nothing wrong with fall through.  The mistake is
> _fallthrough by default_.  Fall through itself is perfectly reasonable; its
> just that the default is wrong.  Like so many others.)
> But, I’m repeating stuff you could just as well have read on
> amber-spec-experts, so I’ll stop here.
> > On Mar 13, 2018, at 7:15 PM, Stephen Colebourne <scolebourne at joda.org>
> wrote:
> >
> > A recent email to amber-spec implies that expression switch will
> > support fall-through.
> > http://mail.openjdk.java.net/pipermail/amber-spec-experts/
> 2018-March/000332.html
> >
> > Is this true? If so, on what basis is this justified?
> >
> > (Fall through in switch is the spawn of the devil. Allowing it in the
> > brand new expression switch would be horrific IMO.)
> >
> > Stephen


Best Regards,
Ali Ebrahimi

More information about the amber-dev mailing list