Skip to content

Commit 23e6d6c

Browse files
committed
Fix constraint merging exception in scalatest
1 parent 06b978a commit 23e6d6c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,12 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
479479
case (e1: TypeBounds, _) if e1 contains e2 => e2
480480
case (_, e2: TypeBounds) if e2 contains e1 => e1
481481
case (tv1: TypeVar, tv2: TypeVar) if tv1 eq tv2 => e1
482+
483+
// Should this be based on the merged entries instead of
484+
// using this.entry/other.entry ?
485+
case (e1: TypeParamRef, e2) if this.entry(e1).bounds.contains(e2) => e2
486+
case (e1, e2: TypeParamRef) if other.entry(e2).bounds.contains(e1) => e1
487+
482488
case _ =>
483489
if (otherHasErrors)
484490
e1

0 commit comments

Comments
 (0)