diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index 77f4f76c33ba..88297e88ce7d 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -258,7 +258,7 @@ object GenericSignatures { if (sym == defn.PairClass && tupleArity(tp) > Definitions.MaxTupleArity) jsig(defn.TupleXXLClass.typeRef) else if (isTypeParameterInSig(sym, sym0)) { - assert(!sym.isAliasType, "Unexpected alias type: " + sym) + assert(!sym.isAliasType || sym.info.isLambdaSub, "Unexpected alias type: " + sym) typeParamSig(sym.name.lastPart) } else if (defn.specialErasure.contains(sym)) @@ -407,7 +407,6 @@ object GenericSignatures { // only refer to type params that will actually make it into the sig, this excludes: - // * higher-order type parameters // * type parameters appearing in method parameters // * type members not visible in an enclosing template private def isTypeParameterInSig(sym: Symbol, initialSymbol: Symbol)(using Context) = diff --git a/tests/pos/i18769.scala b/tests/pos/i18769.scala new file mode 100644 index 000000000000..be5db80b7727 --- /dev/null +++ b/tests/pos/i18769.scala @@ -0,0 +1,9 @@ +trait Arb[Fx[_]] { + def pure[A](x: A): Fx[A] +} + +class PfOps(private val self: Int) extends AnyVal { + def pf[Fy[_]](m: Arb[Fy]): PartialFunction[Int, Fy[Int]] = { + case x => m.pure(x) + } +}