Switch expressions spec

Tagir Valeev amaembo at gmail.com
Fri Mar 1 05:12:09 UTC 2019


Hello!

15.15 says:

The following production from 15.16 is shown here for convenience:

CastExpression:
( PrimitiveType ) UnaryExpression
( ReferenceType {AdditionalBound} ) UnaryExpressionNotPlusMinus
( ReferenceType {AdditionalBound} ) LambdaExpression #

Before it was clear that CastExpression is for completeness here, as
other operators are covered above. Now it's unclear why CastExpression
production is shown here for convenience, but switch expression is not
shown. Probably both should be shown or both removed.

With best regards,
Tagir Valeev.

On Wed, Feb 27, 2019 at 7:43 PM Gavin Bierman <gavin.bierman at oracle.com> wrote:
>
> I have uploaded a revised switch expressions spec at:
>
> http://cr.openjdk.java.net/~gbierman/switch-expressions.html
>
> This is functionally equivalent to the spec uploaded last month. The change is in how we specify the type checking of switch expressions. We have make simplifications to make it more consistent with the specification of conditional expressions. The behaviour of type checking is unchanged.
>
> Thanks,
> Gavin
>
> PS: I have left the January version at http://cr.openjdk.java.net/~gbierman/switch-expressions-old.html for reference.
>
> > On 17 Jan 2019, at 10:14, Gavin Bierman <gavin.bierman at oracle.com> wrote:
> >
> > Thank you Alex and Tagir. I have uploaded a new version of the spec at:
> >
> > http://cr.openjdk.java.net/~gbierman/switch-expressions.html
> >
> > This contains all the changes you suggested below. In addition, there is a small bug fix in 5.6.3 concerning widening (https://bugs.openjdk.java.net/browse/JDK-8213180). I have also taken the opportunity to reorder chapter 15 slightly, so switch expressions are now section 15.28 and constant expressions are now section 15.29 (the last section in the chapter).
> >
> > Comments welcome!
> > Gavin
>


More information about the amber-spec-experts mailing list