diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala index 821095dde886..789b65e8d5a4 100644 --- a/compiler/src/dotty/tools/dotc/ast/tpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala @@ -1149,6 +1149,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { var allAlts = denot.alternatives .map(denot => TermRef(receiver.tpe, denot.symbol)) .filter(tr => typeParamCount(tr) == targs.length) + .filter { _.widen match { + case MethodTpe(_, _, x: MethodType) => !x.isImplicitMethod + case _ => true + }} if (targs.isEmpty) allAlts = allAlts.filterNot(_.widen.isInstanceOf[PolyType]) val alternatives = ctx.typer.resolveOverloaded(allAlts, proto) assert(alternatives.size == 1, diff --git a/tests/run/i6816.scala b/tests/run/i6816.scala new file mode 100644 index 000000000000..26cf87093436 --- /dev/null +++ b/tests/run/i6816.scala @@ -0,0 +1,14 @@ +trait Bar +trait Foo { + def ==(that: Foo)(implicit b: Bar): Boolean = ??? +} + +case class FooCC(f: Foo) + +object Test { + def main(args: Array[String]): Unit = { + val foo1, foo2 = new Foo {} + assert(FooCC(foo1) == FooCC(foo1)) + assert(FooCC(foo1) != FooCC(foo2)) + } +} \ No newline at end of file