Skip to content

Commit 2d35623

Browse files
committed
SyntheticMethods: don't generate hashCode for value classes
It will be added by the VCXPrototype parent class
1 parent 73354cd commit 2d35623

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/dotty/tools/dotc/transform/SyntheticMethods.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import scala.language.postfixOps
3131
* implementation already exists:
3232
*
3333
* def equals(other: Any): Boolean
34-
* def hashCode(): Int
3534
*/
3635
class SyntheticMethods(thisTransformer: DenotTransformer) {
3736
import ast.tpd._
@@ -41,7 +40,7 @@ class SyntheticMethods(thisTransformer: DenotTransformer) {
4140

4241
private def initSymbols(implicit ctx: Context) =
4342
if (myValueSymbols.isEmpty) {
44-
myValueSymbols = List(defn.Any_hashCode, defn.Any_equals)
43+
myValueSymbols = List(defn.Any_equals)
4544
myCaseSymbols = myValueSymbols ++ List(defn.Any_toString, defn.Product_canEqual,
4645
defn.Product_productArity, defn.Product_productPrefix)
4746
}

0 commit comments

Comments
 (0)