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 {
648648 else " Cannot override non-inline parameter with an inline parameter" ,
649649 p1.srcPos)
650650
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 =
654652 if to.isRef(defn.AnyValClass , skipRefined = false )
655653 || 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)
659656}
660657
661658trait Checking {
Original file line number Diff line number Diff line change @@ -3579,7 +3579,7 @@ class Typer extends Namer
35793579 else tree
35803580 else tree // other adaptations for selections are handled in typedSelect
35813581 case _ if ctx.mode.is(Mode .ImplicitsEnabled ) && tree.tpe.isValueType =>
3582- checkConversionsSpecific(wtp, pt, tree.srcPos)
3582+ checkConversionsSpecific(pt, tree.srcPos)
35833583 inferView(tree, pt) match
35843584 case SearchSuccess (found, _, _, isExtension) =>
35853585 if isExtension then found
You can’t perform that action at this time.
0 commit comments