Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate JEP 361: Switch Expressions #22249

Open
tgodzik opened this issue Dec 19, 2024 · 3 comments
Open

Investigate JEP 361: Switch Expressions #22249

tgodzik opened this issue Dec 19, 2024 · 3 comments
Labels
compat:java:jep Issues corresponding to a JEP (JDK Enhancement Proposal) itype:enhancement

Comments

@tgodzik
Copy link
Contributor

tgodzik commented Dec 19, 2024

JEP 361 introduced switch expressions. Since we are planning to update to a newer JDK at an unspecified future I hope we can figure out if this is in any way useful to use for example for some bytecode optimization.

And if we can actually use them or whether it will be impossible for us.

@tgodzik tgodzik added itype:enhancement compat:java:jep Issues corresponding to a JEP (JDK Enhancement Proposal) labels Dec 19, 2024
@He-Pin
Copy link

He-Pin commented Dec 19, 2024

It can't match with null for now, IIRC, there is an new bytecode for type matching, seems slower when the cases are small.
I could like to have scala pattern matching support on Java's record.

@tgodzik
Copy link
Contributor Author

tgodzik commented Dec 19, 2024

I could like to have scala pattern matching support on Java's record.

I wonder if we can get it without updating to the JDK they were introduced at or would this unblock the possibility

@He-Pin
Copy link

He-Pin commented Dec 19, 2024

With multi release jar?Not sure about that, but if Scala support pattern matching on record and still works on Java 8, that will be very cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat:java:jep Issues corresponding to a JEP (JDK Enhancement Proposal) itype:enhancement
Projects
None yet
Development

No branches or pull requests

2 participants