Skip to content

Commit 81732c0

Browse files
authored
Merge pull request #6163 from milessabin/topic/i6058
Use correct type equality in divergence check
2 parents f7eed40 + 78a50f2 commit 81732c0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ abstract class SearchHistory { outer =>
13821382
val wideTp = tp.widenExpr
13831383
lazy val wildTp = wildApprox(wideTp)
13841384
if (belowByname && (wildTp <:< wildPt)) false
1385-
else if ((wideTp.typeSize < ptSize && wideTp.coveringSet == ptCoveringSet) || (wildTp == wildPt)) true
1385+
else if ((wideTp.typeSize < ptSize && wideTp.coveringSet == ptCoveringSet) || (wildTp =:= wildPt)) true
13861386
else loop(tl, isByname(tp) || belowByname)
13871387
}
13881388
else loop(tl, isByname(tp) || belowByname)

tests/neg/i6058.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
object Test {
2+
implicit def i1[I2, I3](i4: I2)(implicit i5: I2 => I3): I3 = ( ) // error
3+
}

0 commit comments

Comments
 (0)