File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1041,9 +1041,13 @@ trait Implicits:
10411041 adapt(generated, pt.widenExpr, locked)
10421042 else {
10431043 def untpdGenerated = untpd.TypedSplice (generated)
1044+ def producesConversion (info : Type ): Boolean = info match
1045+ case info : PolyType => producesConversion(info.resType)
1046+ case info : MethodType if info.isImplicitMethod => producesConversion(info.resType)
1047+ case _ => info.derivesFrom(defn.ConversionClass )
10441048 def tryConversion (using Context ) = {
10451049 val untpdConv =
1046- if ( ref.symbol.is(Given ))
1050+ if ref.symbol.is(Given ) && producesConversion(ref.symbol.info) then
10471051 untpd.Select (
10481052 untpd.TypedSplice (
10491053 adapt(generated,
Original file line number Diff line number Diff line change 1+ def test [A , B ](using c : A <:< B ) =
2+ val b : B = ??? : A
You can’t perform that action at this time.
0 commit comments