diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index 7c7f41f41582..6642f1debbc0 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -208,7 +208,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { private val thisProxy = new mutable.HashMap[ClassSymbol, TermRef] /** A buffer for bindings that define proxies for actual arguments */ - private val bindingsBuf = new mutable.ListBuffer[MemberDef] + private val bindingsBuf = new mutable.ListBuffer[ValOrDefDef] private def newSym(name: Name, flags: FlagSet, info: Type): Symbol = 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) { * @param bindingsBuf the buffer to which the definition should be appended */ private def paramBindingDef(name: Name, paramtp: Type, arg: Tree, - bindingsBuf: mutable.ListBuffer[MemberDef]): MemberDef = { + bindingsBuf: mutable.ListBuffer[ValOrDefDef]): ValOrDefDef = { val argtpe = arg.tpe.dealiasKeepAnnots val isByName = paramtp.dealias.isInstanceOf[ExprType] var inlineFlag = InlineProxy @@ -585,7 +585,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { * - reduce its rhs if it is a projection and adjust its type accordingly, * - record symbol -> rhs in the InlineBindings context propery. */ - def normalizeBinding(binding: MemberDef)(implicit ctx: Context) = { + def normalizeBinding(binding: ValOrDefDef)(implicit ctx: Context) = { val binding1 = binding match { case binding: ValDef => val rhs1 = reduceProjection(binding.rhs) @@ -608,7 +608,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { private object InlineableArg { lazy val paramProxies = paramProxy.values.toSet def unapply(tree: Trees.Ident[_])(implicit ctx: Context): Option[Tree] = { - def search(buf: mutable.ListBuffer[MemberDef]) = buf.find(_.name == tree.name) + def search(buf: mutable.ListBuffer[ValOrDefDef]) = buf.find(_.name == tree.name) if (paramProxies.contains(tree.typeOpt)) search(bindingsBuf) match { case Some(vdef: ValDef) if vdef.symbol.is(Inline) => @@ -651,7 +651,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { case Apply(Select(cl @ closureDef(ddef), nme.apply), args) if defn.isFunctionType(cl.tpe) => ddef.tpe.widen match { case mt: MethodType if ddef.vparamss.head.length == args.length => - val bindingsBuf = new mutable.ListBuffer[MemberDef] + val bindingsBuf = new mutable.ListBuffer[ValOrDefDef] val argSyms = (mt.paramNames, mt.paramInfos, args).zipped.map { (name, paramtp, arg) => arg.tpe.dealias match { case ref @ TermRef(NoPrefix, _) => ref.symbol @@ -694,7 +694,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { * bindings for variables bound in this pattern to `bindingsBuf`. */ def reducePattern( - bindingsBuf: mutable.ListBuffer[MemberDef], + bindingsBuf: mutable.ListBuffer[ValOrDefDef], fromBuf: mutable.ListBuffer[TypeSymbol], toBuf: mutable.ListBuffer[TypeSymbol], scrut: TermRef, @@ -859,7 +859,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { val scrutineeBinding = normalizeBinding(ValDef(scrutineeSym, scrutinee)) def reduceCase(cdef: CaseDef): MatchRedux = { - val caseBindingsBuf = new mutable.ListBuffer[MemberDef]() + val caseBindingsBuf = new mutable.ListBuffer[ValOrDefDef]() def guardOK(implicit ctx: Context) = cdef.guard.isEmpty || { val guardCtx = ctx.fresh.setNewScope caseBindingsBuf.foreach(binding => guardCtx.enter(binding.symbol)) @@ -1105,7 +1105,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { ) val Block(termBindings1, tree1) = inlineTypeBindings(Block(termBindings, tree)) - inlineTermBindings(termBindings1.asInstanceOf[List[MemberDef]], tree1) + inlineTermBindings(termBindings1.asInstanceOf[List[ValOrDefDef]], tree1) } } }