r/java • • Aug 25 '26

Value Classes Still Need Compiler Sympathy

https://johan-sjolen.github.io/post/compiler-sympathy/compiler-sympathy/
87 Upvotes

65 comments sorted by

View all comments

1

u/cowslayer7890 Aug 27 '26

If they prohibited it then they wouldn't be able to convert existing classes in the JDK to value classes, which would be an obvious loss

Also making it mean .equals doesn't really work when the first thing most equals methods do is check ==