Skip to content

Commit 876e6e6

Browse files
committed
Revert specific conversion checking
1 parent 175123a commit 876e6e6

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff 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

661658
trait Checking {

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)