@@ -321,6 +321,28 @@ object Splicer {
321321 protected def interpretNew (fn : Symbol , args : => List [Result ])(implicit env : Env ): Result
322322 protected def unexpectedTree (tree : Tree )(implicit env : Env ): Result
323323
324+ private final def removeEraisedArguments (args : List [Tree ], fnTpe : Type ): List [Tree ] = {
325+ var result = args
326+ var index = 0
327+ def loop (tp : Type ): Unit = tp match {
328+ case tp : TermRef => loop(tp.underlying)
329+ case tp : PolyType => loop(tp.resType)
330+ case tp : MethodType if tp.isErasedMethod =>
331+ tp.paramInfos.foreach { _ =>
332+ result = result.updated(index, null )
333+ index += 1
334+ }
335+ loop(tp.resType)
336+ case tp : MethodType =>
337+ index += tp.paramInfos.size
338+ loop(tp.resType)
339+ case _ => ()
340+ }
341+ loop(fnTpe)
342+ assert(index == args.size)
343+ result.filterNot(null .eq)
344+ }
345+
324346 protected final def interpretTree (tree : Tree )(implicit env : Env ): Result = tree match {
325347 case Apply (TypeApply (fn, _), quoted :: Nil ) if fn.symbol == defn.InternalQuoted_exprQuote =>
326348 val quoted1 = quoted match {
@@ -351,10 +373,12 @@ object Splicer {
351373 interpretModuleAccess(fn.symbol)
352374 } else if (fn.symbol.isStatic) {
353375 val module = fn.symbol.owner
354- interpretStaticMethodCall(module, fn.symbol, args.map(arg => interpretTree(arg)))
376+ def interpretedArgs = removeEraisedArguments(args, fn.tpe).map(arg => interpretTree(arg))
377+ interpretStaticMethodCall(module, fn.symbol, interpretedArgs)
355378 } else if (fn.qualifier.symbol.is(Module ) && fn.qualifier.symbol.isStatic) {
356379 val module = fn.qualifier.symbol.moduleClass
357- interpretStaticMethodCall(module, fn.symbol, args.map(arg => interpretTree(arg)))
380+ def interpretedArgs = removeEraisedArguments(args, fn.tpe).map(arg => interpretTree(arg))
381+ interpretStaticMethodCall(module, fn.symbol, interpretedArgs)
358382 } else if (env.contains(fn.name)) {
359383 env(fn.name)
360384 } else if (tree.symbol.is(InlineProxy )) {
0 commit comments