Make hashcode of enum items stable
Fixes #19177. Done during the compiler issue spree of Monday, May 19th.
Note: hashCode of String is cached (see https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L2403-L2436), so this change should not introduce a significant performance overhead.
I think a proper check should show different cases have different hashes and also if you have a case with an argument that two instances with the same argument have the same hash.
@soronpo I added both tests. This PR only changes the hashcode of "enum values" (cases without parentheses), but it's probably still good to test the other cases as well.