File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -648,14 +648,11 @@ object Checking {
648
648
else " Cannot override non-inline parameter with an inline parameter" ,
649
649
p1.srcPos)
650
650
651
- def checkConversionsSpecific (from : Type , to : Type , pos : SrcPos )(using Context ): Unit =
652
- def fail (part : String , tp : Type ) =
653
- report.error(em " the $part of an implicit conversion must be more specific than $tp" , pos)
651
+ def checkConversionsSpecific (to : Type , pos : SrcPos )(using Context ): Unit =
654
652
if to.isRef(defn.AnyValClass , skipRefined = false )
655
653
|| to.isRef(defn.ObjectClass , skipRefined = false )
656
- then fail(" result" , to)
657
- if from.isBottomTypeAfterErasure
658
- then fail(" argument" , from)
654
+ then
655
+ report.error(em " the result of an implicit conversion must be more specific than $to" , pos)
659
656
}
660
657
661
658
trait Checking {
Original file line number Diff line number Diff line change @@ -3579,7 +3579,7 @@ class Typer extends Namer
3579
3579
else tree
3580
3580
else tree // other adaptations for selections are handled in typedSelect
3581
3581
case _ if ctx.mode.is(Mode .ImplicitsEnabled ) && tree.tpe.isValueType =>
3582
- checkConversionsSpecific(wtp, pt, tree.srcPos)
3582
+ checkConversionsSpecific(pt, tree.srcPos)
3583
3583
inferView(tree, pt) match
3584
3584
case SearchSuccess (found, _, _, isExtension) =>
3585
3585
if isExtension then found
You can’t perform that action at this time.
0 commit comments