Effect cases in switch

Brian Goetz brian.goetz at oracle.com
Thu Dec 14 15:49:39 UTC 2023


One of the many reasons in-args should be effectively final.

On 12/14/2023 2:16 AM, John Rose wrote:
>
> P.S. If we ever get in-args into patterns it gets even more wooly,
> since those would be little expressions embedded in random places
> in the case patterns, and would be evaluated at unpredictable
> moments by the synthetic switch decision logic. They probably
> need to be eta-converted (aka lambda-quoted) if they have any
> side-effects. For more amusement on eta-conversion/lambda-quoting,
> you might like this:
> https://cr.openjdk.org/~jrose/jls/eta-abstraction-expr-quoting.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-experts/attachments/20231214/4f1fc8c7/attachment-0001.htm>


More information about the amber-spec-experts mailing list