File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3535,7 +3535,9 @@ class Typer extends Namer
35353535 else err.typeMismatch(tree, pt, failure)
35363536
35373537 if ctx.mode.is(Mode .ImplicitsEnabled ) && tree.typeOpt.isValueType then
3538- if pt.isRef(defn.AnyValClass ) || pt.isRef(defn.ObjectClass ) then
3538+ if pt.isRef(defn.AnyValClass , skipRefined = false )
3539+ || pt.isRef(defn.ObjectClass , skipRefined = false )
3540+ then
35393541 report.error(em " the result of an implicit conversion must be more specific than $pt" , tree.srcPos)
35403542 inferView(tree, pt) match {
35413543 case SearchSuccess (found : ExtMethodApply , _, _) =>
Original file line number Diff line number Diff line change 1+ import scala .reflect .Selectable .reflectiveSelectable
2+
3+ object Test {
4+ def main (args : Array [String ]): Unit = {
5+ def fCompareToBoolean (x : { def compareTo (y : java.lang.Boolean ): Int }, y : Boolean ): Int =
6+ x.compareTo(y)
7+ assert(fCompareToBoolean(false , true ) < 0 )
8+ }
9+ }
You can’t perform that action at this time.
0 commit comments