Skip to content

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

@TheLastRar

Description

@TheLastRar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions