Skip to content

Commit f931b2d

Browse files
committed
Missing stripMethodPrefix in erasure of method calls.
1 parent ec0a71b commit f931b2d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,14 @@ object Erasure {
454454
ref(meth).appliedToArgs(args.toList ++ followingArgs)
455455
}
456456

457-
private def protoArgs(pt: Type, methTp: Type): List[untpd.Tree] = (pt, methTp) match {
458-
case (pt: FunProto, methTp: MethodType) if methTp.isErasedMethod =>
459-
protoArgs(pt.resType, methTp.resType)
460-
case (pt: FunProto, methTp: MethodType) =>
461-
pt.args ++ protoArgs(pt.resType, methTp.resType)
462-
case _ => Nil
463-
}
457+
private def protoArgs(pt: Type, methTp: Type)(implicit ctx: Context): List[untpd.Tree] =
458+
(pt, methTp.stripMethodPrefix) match {
459+
case (pt: FunProto, methTp: MethodType) if methTp.isErasedMethod =>
460+
protoArgs(pt.resType, methTp.resType)
461+
case (pt: FunProto, methTp: MethodType) =>
462+
pt.args ++ protoArgs(pt.resType, methTp.resType)
463+
case _ => Nil
464+
}
464465

465466
override def typedTypeApply(tree: untpd.TypeApply, pt: Type)(implicit ctx: Context) = {
466467
val ntree = interceptTypeApply(tree.asInstanceOf[TypeApply])(ctx.withPhase(ctx.erasurePhase))

0 commit comments

Comments
 (0)