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

Identical lambda expression not garanteed by spec to be equal #79

Open
TheLastRar opened this issue Jun 7, 2023 · 0 comments
Open

Identical lambda expression not garanteed by spec to be equal #79

TheLastRar opened this issue Jun 7, 2023 · 0 comments

Comments

@TheLastRar
Copy link

https://docs.oracle.com/javase/specs/jls/se17/html/jls-15.html#jls-15.27.4

This implies that the identity of the result of evaluating a lambda expression (or, of serializing and deserializing a lambda expression) is unpredictable, and therefore identity-sensitive operations (such as reference equality (§15.21.3), object locking (§14.19), and the System.identityHashCode method) may produce different results in different implementations of the Java programming language, or even upon different lambda expression evaluations in the same implementation.

Yet this behaviour is relied upon in the hashCode/equals functions in TypeRewriteRule.OrElse

This was found when testing Minecraft 1.13.21 on IKVM, an alternative JVM ikvmnet/ikvm#342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant