Skip to content

Commit 15644d6

Browse files
committed
Fix MethodOrPoly
We need to add structural `equals` since MethodOrPoly's can be part of RefinedTypes.
1 parent 7cd930b commit 15644d6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -2734,11 +2734,10 @@ object Types {
27342734

27352735
abstract class MethodOrPoly extends UncachedGroundType with LambdaType with MethodicType {
27362736
final override def hashCode = System.identityHashCode(this)
2737-
final override def equals(other: Any) = this `eq` other.asInstanceOf[AnyRef]
27382737

27392738
final override def equals(that: Any) = equals(that, null)
27402739

2741-
// No definition of `eql` --> fall back on equals, which calls iso
2740+
// No definition of `eql` --> fall back on equals, which is `eq`
27422741

27432742
final override def iso(that: Any, bs: BinderPairs) = that match {
27442743
case that: MethodOrPoly =>

0 commit comments

Comments
 (0)