Fw: JEP 455: Non-enhanced switch statements

Attila Kelemen attila.kelemen85 at gmail.com
Sun Oct 29 20:21:52 UTC 2023


If such a warning would be implemented, would it be possible to also add
selective `-Werror` (same syntax as `-Xlint`)? Because then it would be
possible for people to turn on "exhaustive switch" at will (which would be
awesome in my opinion). Selectiveness of `-Werror` is necessary for this,
because there are warnings that I wouldn't want to turn off, but don't want
an outright build failure, because of them. Also, selective `-Werror` would
be useful for some other warnings as well.

Attila

Brian Goetz <brian.goetz at oracle.com> ezt írta (időpont: 2023. okt. 29., V,
21:09):

> At the same time, we should consider a lint warning for non-exhaustive
> old-style switches, which a recommendation to make them exhaustive with
> `default:` or `default -> {}`, depending on the switch style.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-comments/attachments/20231029/ee3d79e6/attachment.htm>


More information about the amber-spec-comments mailing list