@@ -126,11 +126,13 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context):
126126 view.toList
127127
128128 fnType.dealias match
129- case fnType : MethodType if fnType.hasErasedParams => interpretArgs(argss, fnType.resType)
130129 case fnType : MethodType =>
131130 val argTypes = fnType.paramInfos
132131 assert(argss.head.size == argTypes.size)
133- interpretArgsGroup(argss.head, argTypes) ::: interpretArgs(argss.tail, fnType.resType)
132+ val nonErasedArgs = argss.head.lazyZip(fnType.erasedParams).collect { case (arg, false ) => arg }.toList
133+ val nonErasedArgTypes = fnType.paramInfos.lazyZip(fnType.erasedParams).collect { case (arg, false ) => arg }.toList
134+ assert(nonErasedArgs.size == nonErasedArgTypes.size)
135+ interpretArgsGroup(nonErasedArgs, nonErasedArgTypes) ::: interpretArgs(argss.tail, fnType.resType)
134136 case fnType : AppliedType if defn.isContextFunctionType(fnType) =>
135137 val argTypes :+ resType = fnType.args: @ unchecked
136138 interpretArgsGroup(argss.head, argTypes) ::: interpretArgs(argss.tail, resType)
@@ -328,8 +330,8 @@ object Interpreter:
328330 object Call :
329331 import tpd ._
330332 /** Matches an expression that is either a field access or an application
331- * It retruns a TermRef containing field accessed or a method reference and the arguments passed to it.
332- */
333+ * It returns a TermRef containing field accessed or a method reference and the arguments passed to it.
334+ */
333335 def unapply (arg : Tree )(using Context ): Option [(RefTree , List [List [Tree ]])] =
334336 Call0 .unapply(arg).map((fn, args) => (fn, args.reverse))
335337
@@ -339,10 +341,8 @@ object Interpreter:
339341 Some ((fn, args))
340342 case fn : Ident => Some ((tpd.desugarIdent(fn).withSpan(fn.span), Nil ))
341343 case fn : Select => Some ((fn, Nil ))
342- case Apply (f @ Call0 (fn, args1), args2) =>
343- if (f.tpe.widenDealias.hasErasedParams) Some ((fn, args1))
344- else Some ((fn, args2 :: args1))
345- case TypeApply (Call0 (fn, args), _) => Some ((fn, args))
344+ case Apply (f @ Call0 (fn, argss), args) => Some ((fn, args :: argss))
345+ case TypeApply (Call0 (fn, argss), _) => Some ((fn, argss))
346346 case _ => None
347347 }
348348 }
0 commit comments