File tree 2 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/typer 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
3535
3535
else err.typeMismatch(tree, pt, failure)
3536
3536
3537
3537
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
3539
3541
report.error(em " the result of an implicit conversion must be more specific than $pt" , tree.srcPos)
3540
3542
inferView(tree, pt) match {
3541
3543
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