diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index 15902b90ad20..b1475c01f735 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -1382,7 +1382,7 @@ abstract class SearchHistory { outer => val wideTp = tp.widenExpr lazy val wildTp = wildApprox(wideTp) if (belowByname && (wildTp <:< wildPt)) false - else if ((wideTp.typeSize < ptSize && wideTp.coveringSet == ptCoveringSet) || (wildTp == wildPt)) true + else if ((wideTp.typeSize < ptSize && wideTp.coveringSet == ptCoveringSet) || (wildTp =:= wildPt)) true else loop(tl, isByname(tp) || belowByname) } else loop(tl, isByname(tp) || belowByname) diff --git a/tests/neg/i6058.scala b/tests/neg/i6058.scala new file mode 100644 index 000000000000..612bd9066b02 --- /dev/null +++ b/tests/neg/i6058.scala @@ -0,0 +1,3 @@ +object Test { + implicit def i1[I2, I3](i4: I2)(implicit i5: I2 => I3): I3 = ( ) // error +}