File tree 2 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1041,9 +1041,13 @@ trait Implicits:
1041
1041
adapt(generated, pt.widenExpr, locked)
1042
1042
else {
1043
1043
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 )
1044
1048
def tryConversion (using Context ) = {
1045
1049
val untpdConv =
1046
- if ( ref.symbol.is(Given ))
1050
+ if ref.symbol.is(Given ) && producesConversion(ref.symbol.info) then
1047
1051
untpd.Select (
1048
1052
untpd.TypedSplice (
1049
1053
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