News for hackers. Stuff that matters.
Re:Go 2 Draft Designs by dtech on Thursday August 30, 2018 @05:58AM (#17875417)
There definitely are cases where that's not enough, but it's a 95-99% solution.

The problems you mentioned:

Classes could change equals to accept subclasses. Then subclasses could not alter equality themselves.

T implementing `equals(other: U)` for some U solves a lot of other use-cases, but could make equality asymetrical.

Reference equality would still exist, but would not be the default, e.g. Java's `equals` is Scala's `==`, and Java's `==` is Scala's `eq` operator (which you almost never use)

Re:Go 2 Draft Designs by naasking on Thursday August 30, 2018 @12:08PM (#17877826)