Skip to content

HashCode of enum cases is not stable #19177

Open
@Lasering

Description

@Lasering

Compiler version

3.3.1

Minimized code

enum Test:
  case A

Test.A.hashCode

Scastie

Output

The outputted value changes for each run. Most likely the hashCode is being computed from the memory position.

Expectation

The hashCode should be stable across multiple JVMs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions