Skip to content

Commit 14551e2

Browse files
oderskysmarter
authored andcommitted
Refine mergeEntries
If entries are type variables, we have to check their instances for equality. This came up onder the new or handling scheme.
1 parent d47f328 commit 14551e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dotty/tools/dotc/core/OrderingConstraint.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
521521
case _ if e1 contains e2 => e2
522522
case _ => mergeError
523523
}
524+
case tv1: TypeVar =>
525+
e2 match {
526+
case tv2: TypeVar if tv1.instanceOpt eq tv2.instanceOpt => e1
527+
case _ => mergeError
528+
}
524529
case _ if e1 eq e2 => e1
525530
case _ => mergeError
526531
}

0 commit comments

Comments
 (0)