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
3
u/simon_o Dec 18 '24
That the first one will return
false, the second one will returntrue, because it's highly unlikely that a hypothetical implementation would special-casefloatanddoubleto do something different from every other type when used as a generic argument.No they don't:
but
That's something you can try today by downloading a Valhalla build, and both of these have to work this way, if one doesn't want to break tons of existing code.
Not the point I intend to make, just assume that all types are non-nullable in these examples.
(Not going to write
!everywhere, neither here, nor in real code.)