Skip to content

Commit

Permalink
Fix scala#10900: Avoid loop for F-bounds in checkCanEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun authored and olsdavis committed Apr 4, 2022
1 parent e9c9d38 commit a4e3824
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,8 @@ trait Implicits:
apply(t.widen)
case t: RefinedType =>
apply(t.parent)
case t: LazyRef =>
t
case _ =>
if (variance > 0) mapOver(t) else t
}
Expand Down
3 changes: 3 additions & 0 deletions tests/pos/i10900.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import scala.collection.IterableOps
def foo[CC[A] <: IterableOps[A, CC, CC[A]], A](collection: CC[A]) =
collection == collection

0 comments on commit a4e3824

Please sign in to comment.