@@ -470,7 +470,7 @@ object Inlines:
470
470
import tpd ._
471
471
import Inlines .*
472
472
473
- private val thisInlineTraitProxy = ThisType .raw(TypeRef (ctx.owner.prefix, ctx.owner))
473
+ private val thisInlineTrait = ThisType .raw(TypeRef (ctx.owner.prefix, ctx.owner))
474
474
475
475
def expandDefs (): List [Tree ] =
476
476
val tpd .Block (stats, _) = Inlines .bodyToInline(parentSym): @ unchecked
@@ -481,26 +481,26 @@ object Inlines:
481
481
482
482
protected class InlineTraitTypeMap extends InlinerTypeMap {
483
483
override def apply (t : Type ) = t match {
484
- case t : ThisType if t.cls == parentSym => thisInlineTraitProxy
484
+ case t : ThisType if t.cls == parentSym => thisInlineTrait
485
485
case t => super .apply(t)
486
486
}
487
487
}
488
488
489
489
override protected val inlinerTypeMap : InlinerTypeMap = InlineTraitTypeMap ()
490
490
491
491
private val paramAccessorsValueOf : Map [Name , Tree ] =
492
- def allArgs (tree : Tree ): List [List [Tree ]] = tree match
493
- case Apply (fun, args) => args :: allArgs(fun)
494
- case TypeApply (fun, _) => allArgs(fun)
495
- case _ => Nil
496
- def allParams (info : Type ): List [List [Name ]] = info match
497
- case mt : MethodType => mt.paramNames :: allParams(mt.resultType )
498
- case pt : PolyType => allParams(pt.resultType)
499
- case _ => Nil
492
+ def allArgs (tree : Tree , acc : Vector [ List [ Tree ]] ): List [List [Tree ]] = tree match
493
+ case Apply (fun, args) => allArgs(fun, acc :+ args )
494
+ case TypeApply (fun, _) => allArgs(fun, acc )
495
+ case _ => acc.toList
496
+ def allParams (info : Type , acc : List [ List [ Name ]] ): List [List [Name ]] = info match
497
+ case mt : MethodType => allParams( mt.resultType, mt. paramNames :: acc )
498
+ case pt : PolyType => allParams(pt.resultType, acc )
499
+ case _ => acc
500
500
val info =
501
501
if parent.symbol.isClass then parent.symbol.primaryConstructor.info
502
502
else parent.symbol.info
503
- allParams(info).flatten.zip(allArgs(parent).reverse .flatten).toMap
503
+ allParams(info, Nil ).flatten.zip(allArgs(parent, Vector .empty) .flatten).toMap
504
504
505
505
private def isStatAlreadyOverridden (stat : Tree ): Boolean =
506
506
overriddenDecls.contains(stat.symbol)
0 commit comments