Skip to content

Commit bc8dc65

Browse files
author
gorilskij
committed
special-case inline extension unapplySeq (including polymorphic variants)
1 parent 8bc5e73 commit bc8dc65

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,15 @@ object Inliner {
203203
val targs = fun match
204204
case TypeApply(_, targs) => targs
205205
case _ => Nil
206+
206207
val unapplyInfo = sym.info match
207-
case info: PolyType => info.instantiate(targs.map(_.tpe))
208-
case MethodTpe(_, _, rest) if sym.flags.is(ExtensionMethod) => rest
208+
case info: PolyType => info.instantiate(targs.map(_.tpe)) match
209+
case MethodTpe(_, _, rt: PolyType) => rt.instantiate(targs.map(_.tpe))
210+
case MethodTpe(_, _, rt) if sym.flags.is(ExtensionMethod) => rt
211+
case info => info
212+
213+
case MethodTpe(_, _, rt: PolyType) => rt.instantiate(targs.map(_.tpe))
214+
case MethodTpe(_, _, rt) if sym.flags.is(ExtensionMethod) => rt
209215
case info => info
210216

211217
val unappplySym = newSymbol(cls, sym.name.toTermName, Synthetic | Method, unapplyInfo, coord = sym.coord).entered

0 commit comments

Comments
 (0)