Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,13 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
* @param arg the argument corresponding to the parameter
* @param bindingsBuf the buffer to which the definition should be appended
*/
private def paramBindingDef(name: Name, paramtp: Type, arg: Tree,
private def paramBindingDef(name: Name, paramtp: Type, arg0: Tree,
bindingsBuf: mutable.ListBuffer[ValOrDefDef])(implicit ctx: Context): ValOrDefDef = {
val arg = arg0 match {
case Typed(arg1, tpt) if tpt.tpe.isRepeatedParam && arg1.tpe.derivesFrom(defn.ArrayClass) =>
wrapArray(arg1, arg0.tpe.elemType)
case _ => arg0
}
val argtpe = arg.tpe.dealiasKeepAnnots
val isByName = paramtp.dealias.isInstanceOf[ExprType]
var inlineFlags: FlagSet = InlineProxy
Expand Down
10 changes: 10 additions & 0 deletions tests/run/i6858.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
object Test extends App {
inline def foo(ys: Int*): Unit = bar(ys: _*)
def bar(ys: Int*) = ()

val xs: Array[Int] = new Array[Int](3)
foo(xs: _*)

val ys: Seq[Int] = new Array[Int](3)
foo(ys: _*)
}