File tree 1 file changed +4
-5
lines changed
compiler/src/dotty/tools/dotc/transform
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -536,19 +536,18 @@ object Erasure {
536
536
537
537
/** Besides normal typing, this method does uncurrying and collects parameters
538
538
* to anonymous functions of arity > 22.
539
- *
540
- */
539
+ */
541
540
override def typedApply (tree : untpd.Apply , pt : Type )(implicit ctx : Context ): Tree =
542
541
val Apply (fun, args) = tree
543
- if ( fun.symbol == defn.cbnArg)
542
+ if fun.symbol == defn.cbnArg then
544
543
typedUnadapted(args.head, pt)
545
544
else
546
545
val origFun = fun.asInstanceOf [tpd.Tree ]
547
546
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)
549
549
val ownArgs = if origFunType.isErasedMethod then Nil else args
550
550
val args0 = outers ::: ownArgs
551
- val fun1 = typedExpr(fun, AnyFunctionProto )
552
551
fun1.tpe.widen match
553
552
case mt : MethodType =>
554
553
val bunchArgs = mt.paramInfos match
You can’t perform that action at this time.
0 commit comments