Skip to content

Commit af6f913

Browse files
committed
Fix #6828: Support by-name synthesized implicits
1 parent cba756d commit af6f913

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
@@ -1067,7 +1067,7 @@ trait Implicits { self: Typer =>
10671067
}
10681068
val base = baseWithRefinements(formal)
10691069
val result =
1070-
if (base <:< formal) {
1070+
if (base <:< formal.widenExpr) {
10711071
// With the subtype test we enforce that the searched type `formal` is of the right form
10721072
handler(base, span)(ctx)
10731073
}

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)