Skip to content

Commit c10367c

Browse files
committed
Correct ##.
1 parent 503bd27 commit c10367c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/library/scala/runtime/Statics.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ public static int anyHash(Object x) {
112112
if (x instanceof java.lang.Float)
113113
return floatHash(((java.lang.Float)x).floatValue());
114114

115+
if (x instanceof scala.UByte)
116+
return ((scala.UByte)x).underlying() & 0xff;
117+
118+
if (x instanceof scala.UShort)
119+
return ((scala.UShort)x).underlying() & 0xffff;
120+
121+
/* Amazingly, scala.UInt and scala.ULong do not need a special treatment,
122+
* because their generated hashCode() will do the right thing.
123+
*/
124+
115125
return x.hashCode();
116126
}
117127
}

0 commit comments

Comments
 (0)