diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index a1e26c20fdbb..735d87a98d44 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -278,7 +278,7 @@ object TypeOps: } case AndType(tp11, tp12) => mergeRefinedOrApplied(tp11, tp2) & mergeRefinedOrApplied(tp12, tp2) - case tp1: TypeParamRef if tp1 == tp2 => tp1 + case tp1: TypeParamRef if tp1 =:= tp2 => tp1 case _ => fail } } diff --git a/tests/pos/i23032.scala b/tests/pos/i23032.scala new file mode 100644 index 000000000000..1eb5494ca4b7 --- /dev/null +++ b/tests/pos/i23032.scala @@ -0,0 +1,2 @@ +def f[F[_], T]: F[Unit] | F[T] = ??? +def x[F[_]] = f.toString