File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -518,7 +518,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
518518 case tp1 : MethodOrPoly =>
519519 (tp1.signature consistentParams tp2.signature) &&
520520 matchingParams(tp1, tp2) &&
521- tp1 .isImplicitMethod == tp2 .isImplicitMethod &&
521+ ( ! tp2 .isImplicitMethod || tp1 .isImplicitMethod) &&
522522 isSubType(tp1.resultType, tp2.resultType.subst(tp2, tp1))
523523 case _ =>
524524 false
Original file line number Diff line number Diff line change @@ -470,7 +470,7 @@ object ProtoTypes {
470470 normalize(et.resultType, pt)
471471 case wtp =>
472472 val iftp = defn.asImplicitFunctionType(wtp)
473- if (iftp.exists) normalize(iftp.argInfos.last, pt) else tp
473+ if (iftp.exists) normalize(iftp.dropDependentRefinement. argInfos.last, pt) else tp
474474 }
475475 }
476476
Original file line number Diff line number Diff line change 11object test1 {
22 class C [A ] { def foo (a : A ) = " c" }
3- class D extends C [String ] { override def foo (implicit s : String ) = " d" } // error
3+ class D extends C [String ] { override def foo (implicit s : String ) = " d" } // used to be error, now ok
44}
55
66object test2 {
Original file line number Diff line number Diff line change 1+ class C { type T }
2+
3+ object Main {
4+
5+ // val a: implicit Int => Int = implicit (x: Int) => x
6+ // val b: Int => Int = a
7+
8+ def main (args : Array [String ]): Unit = {
9+ val choose : implicit (c : C ) => Set [Int ] = Set .empty
10+ val b0 : (C ) => Set [Int ] = choose
11+ val b1 : (c : C ) => Set [Int ] = choose
12+ def applyF (f : (c : C ) => Set [Int ]) = f(new C {type T = Int })
13+ // applyF(choose)
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments