Skip to content

Commit d0d43f8

Browse files
Merge pull request #6829 from dotty-staging/fix-#6828
Fix #6828: Support by-name synthesized implicits
2 parents ec59536 + af6f913 commit d0d43f8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-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
@@ -1086,7 +1086,7 @@ trait Implicits { self: Typer =>
10861086
}
10871087
val base = baseWithRefinements(formal)
10881088
val result =
1089-
if (base <:< formal) {
1089+
if (base <:< formal.widenExpr) {
10901090
// With the subtype test we enforce that the searched type `formal` is of the right form
10911091
handler(base, span)(ctx)
10921092
}

tests/pos/i6828.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Foo {
2+
inline def foo[T](implicit ct: =>scala.reflect.ClassTag[T]): Unit = Unit
3+
foo[Int]
4+
foo[String]
5+
}

0 commit comments

Comments
 (0)