File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -536,19 +536,18 @@ object Erasure {
536536
537537 /** Besides normal typing, this method does uncurrying and collects parameters
538538 * to anonymous functions of arity > 22.
539- *
540- */
539+ */
541540 override def typedApply (tree : untpd.Apply , pt : Type )(implicit ctx : Context ): Tree =
542541 val Apply (fun, args) = tree
543- if ( fun.symbol == defn.cbnArg)
542+ if fun.symbol == defn.cbnArg then
544543 typedUnadapted(args.head, pt)
545544 else
546545 val origFun = fun.asInstanceOf [tpd.Tree ]
547546 val origFunType = origFun.tpe.widen(using preErasureCtx)
548- val outers = outer.args(origFun)
547+ val fun1 = typedExpr(fun, AnyFunctionProto )
548+ val outers = if fun1.isInstanceOf [Apply ] then Nil else outer.args(origFun)
549549 val ownArgs = if origFunType.isErasedMethod then Nil else args
550550 val args0 = outers ::: ownArgs
551- val fun1 = typedExpr(fun, AnyFunctionProto )
552551 fun1.tpe.widen match
553552 case mt : MethodType =>
554553 val bunchArgs = mt.paramInfos match
You can’t perform that action at this time.
0 commit comments