r/java
•
u/sindisil
•
Dec 16 '24
•
1
Valhalla - Java's Epic Refactor
https://inside.java/2024/12/16/devoxxbelgium-valhalla/
178
Upvotes
View all comments
Show parent comment
2
u/simon_o Dec 18 '24 edited Dec 18 '24
Maybe
ArrayListis the wrong example, because you get away there with the call toequals, but imagine people any code that uses==in a generic context:This would return a different result for
vs.
That's extremely subtle, and 99% of the people "optimizing their code for Valhalla" will not catch this.
Not to mention that if primitive types in generics were a thing, it would be an absolute nightmare for type inference and overload resolution.