Skip to content

Commit a910cc8

Browse files
committed
Improve variable names
1 parent 957028c commit a910cc8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,11 @@ object Erasure {
461461
ref(meth).appliedToArgs(args.toList ++ followingArgs)
462462
}
463463

464-
private def protoArgs(pt: Type, tp: Type): List[untpd.Tree] = (pt, tp) match {
465-
case (pt: FunProto, tp: MethodType) if tp.isUnusedMethod => protoArgs(pt.resType, tp.resType)
466-
case (pt: FunProto, tp: MethodType) => pt.args ++ protoArgs(pt.resType, tp.resType)
464+
private def protoArgs(pt: Type, methTp: Type): List[untpd.Tree] = (pt, methTp) match {
465+
case (pt: FunProto, methTp: MethodType) if methTp.isUnusedMethod =>
466+
protoArgs(pt.resType, methTp.resType)
467+
case (pt: FunProto, methTp: MethodType) =>
468+
pt.args ++ protoArgs(pt.resType, methTp.resType)
467469
case _ => Nil
468470
}
469471

@@ -497,9 +499,8 @@ object Erasure {
497499
fun1.tpe.widen match {
498500
case mt: MethodType =>
499501
val outers = outer.args(fun.asInstanceOf[tpd.Tree]) // can't use fun1 here because its type is already erased
500-
var args0 = protoArgs(pt, tree.typeOpt)
501-
if (mt.paramNames.nonEmpty && !mt.isUnusedMethod) args0 = args ::: args0
502-
args0 = outers ::: args0
502+
val ownArgs = if (mt.paramNames.nonEmpty && !mt.isUnusedMethod) args else Nil
503+
var args0 = outers ::: ownArgs ::: protoArgs(pt, tree.typeOpt)
503504

504505
if (args0.length > MaxImplementedFunctionArity && mt.paramInfos.length == 1) {
505506
val bunchedArgs = untpd.JavaSeqLiteral(args0, TypeTree(defn.ObjectType))

0 commit comments

Comments
 (0)