@@ -208,7 +208,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
208
208
private val thisProxy = new mutable.HashMap [ClassSymbol , TermRef ]
209
209
210
210
/** A buffer for bindings that define proxies for actual arguments */
211
- private val bindingsBuf = new mutable.ListBuffer [MemberDef ]
211
+ private val bindingsBuf = new mutable.ListBuffer [ValOrDefDef ]
212
212
213
213
private def newSym (name : Name , flags : FlagSet , info : Type ): Symbol =
214
214
ctx.newSymbol(ctx.owner, name, flags, info, coord = call.span)
@@ -223,7 +223,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
223
223
* @param bindingsBuf the buffer to which the definition should be appended
224
224
*/
225
225
private def paramBindingDef (name : Name , paramtp : Type , arg : Tree ,
226
- bindingsBuf : mutable.ListBuffer [MemberDef ]): MemberDef = {
226
+ bindingsBuf : mutable.ListBuffer [ValOrDefDef ]): ValOrDefDef = {
227
227
val argtpe = arg.tpe.dealiasKeepAnnots
228
228
val isByName = paramtp.dealias.isInstanceOf [ExprType ]
229
229
var inlineFlag = InlineProxy
@@ -585,7 +585,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
585
585
* - reduce its rhs if it is a projection and adjust its type accordingly,
586
586
* - record symbol -> rhs in the InlineBindings context propery.
587
587
*/
588
- def normalizeBinding (binding : MemberDef )(implicit ctx : Context ) = {
588
+ def normalizeBinding (binding : ValOrDefDef )(implicit ctx : Context ) = {
589
589
val binding1 = binding match {
590
590
case binding : ValDef =>
591
591
val rhs1 = reduceProjection(binding.rhs)
@@ -608,7 +608,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
608
608
private object InlineableArg {
609
609
lazy val paramProxies = paramProxy.values.toSet
610
610
def unapply (tree : Trees .Ident [_])(implicit ctx : Context ): Option [Tree ] = {
611
- def search (buf : mutable.ListBuffer [MemberDef ]) = buf.find(_.name == tree.name)
611
+ def search (buf : mutable.ListBuffer [ValOrDefDef ]) = buf.find(_.name == tree.name)
612
612
if (paramProxies.contains(tree.typeOpt))
613
613
search(bindingsBuf) match {
614
614
case Some (vdef : ValDef ) if vdef.symbol.is(Inline ) =>
@@ -651,7 +651,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
651
651
case Apply (Select (cl @ closureDef(ddef), nme.apply), args) if defn.isFunctionType(cl.tpe) =>
652
652
ddef.tpe.widen match {
653
653
case mt : MethodType if ddef.vparamss.head.length == args.length =>
654
- val bindingsBuf = new mutable.ListBuffer [MemberDef ]
654
+ val bindingsBuf = new mutable.ListBuffer [ValOrDefDef ]
655
655
val argSyms = (mt.paramNames, mt.paramInfos, args).zipped.map { (name, paramtp, arg) =>
656
656
arg.tpe.dealias match {
657
657
case ref @ TermRef (NoPrefix , _) => ref.symbol
@@ -694,7 +694,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
694
694
* bindings for variables bound in this pattern to `bindingsBuf`.
695
695
*/
696
696
def reducePattern (
697
- bindingsBuf : mutable.ListBuffer [MemberDef ],
697
+ bindingsBuf : mutable.ListBuffer [ValOrDefDef ],
698
698
fromBuf : mutable.ListBuffer [TypeSymbol ],
699
699
toBuf : mutable.ListBuffer [TypeSymbol ],
700
700
scrut : TermRef ,
@@ -859,7 +859,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
859
859
val scrutineeBinding = normalizeBinding(ValDef (scrutineeSym, scrutinee))
860
860
861
861
def reduceCase (cdef : CaseDef ): MatchRedux = {
862
- val caseBindingsBuf = new mutable.ListBuffer [MemberDef ]()
862
+ val caseBindingsBuf = new mutable.ListBuffer [ValOrDefDef ]()
863
863
def guardOK (implicit ctx : Context ) = cdef.guard.isEmpty || {
864
864
val guardCtx = ctx.fresh.setNewScope
865
865
caseBindingsBuf.foreach(binding => guardCtx.enter(binding.symbol))
@@ -1105,7 +1105,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
1105
1105
)
1106
1106
1107
1107
val Block (termBindings1, tree1) = inlineTypeBindings(Block (termBindings, tree))
1108
- inlineTermBindings(termBindings1.asInstanceOf [List [MemberDef ]], tree1)
1108
+ inlineTermBindings(termBindings1.asInstanceOf [List [ValOrDefDef ]], tree1)
1109
1109
}
1110
1110
}
1111
1111
}
0 commit comments