diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala index ab0c8d449d00..93d95bec0bff 100644 --- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala +++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala @@ -385,7 +385,7 @@ object Erasure { case _: FunProto | AnyFunctionProto => tree case _ => tree.tpe.widen match case mt: MethodType if tree.isTerm => - assert(mt.paramInfos.isEmpty) + assert(mt.paramInfos.isEmpty)//, i"bad adapt for $tree: $mt") adaptToType(tree.appliedToNone, pt) case tpw => if (pt.isInstanceOf[ProtoType] || tree.tpe <:< pt) diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 232018bc7cd0..a442f2b23999 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -1176,7 +1176,8 @@ class Namer { typer: Typer => import tpd._ val ref = path.select(sym.asTerm) val ddef = tpd.DefDef(forwarder.asTerm, prefss => - ref.appliedToArgss(adaptForwarderParams(Nil, sym.info, prefss))) + ref.appliedToArgss(adaptForwarderParams(Nil, sym.info, prefss)) + .etaExpandCFT(using ctx.withOwner(forwarder))) if forwarder.isInlineMethod then PrepareInlineable.registerInlineInfo(forwarder, ddef.rhs) buf += ddef.withSpan(span) diff --git a/compiler/test/dotc/pos-test-pickling.blacklist b/compiler/test/dotc/pos-test-pickling.blacklist index b42d41f0df85..b099805a139f 100644 --- a/compiler/test/dotc/pos-test-pickling.blacklist +++ b/compiler/test/dotc/pos-test-pickling.blacklist @@ -18,6 +18,7 @@ i7740b.scala i6507b.scala i12299a.scala i13871.scala +i15181.scala # Tree is huge and blows stack for printing Text i7034.scala diff --git a/tests/pos/i15181.scala b/tests/pos/i15181.scala new file mode 100644 index 000000000000..def1152e0de3 --- /dev/null +++ b/tests/pos/i15181.scala @@ -0,0 +1,9 @@ +object prelude: + //def scombine[A](x: A, y: A): Semigroup[A] ?=> A = Semigroup.scombine(x,y) + export Semigroup.* + +trait Semigroup[A]: + def scombine(x: A, y: A): A + +object Semigroup: + def scombine[A](x: A, y: A) = (s: Semigroup[A]) ?=> s.scombine(x,y) \ No newline at end of file