@@ -1500,21 +1500,22 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
1500
1500
if desugared.isEmpty then
1501
1501
val inferredParams : List [untpd.ValDef ] =
1502
1502
for ((param, i) <- params.zipWithIndex) yield
1503
- if (! param.tpt.isEmpty) param
1504
- else
1505
- val (formal, isErased) = protoFormal(i)
1506
- val knownFormal = isFullyDefined(formal, ForceDegree .failBottom)
1507
- val paramType =
1508
- if knownFormal then formal
1509
- else inferredFromTarget(param, formal, calleeType, paramIndex)
1510
- .orElse(errorType(AnonymousFunctionMissingParamType (param, tree, formal), param.srcPos))
1511
- val paramTpt = untpd.TypedSplice (
1512
- (if knownFormal then InferredTypeTree () else untpd.TypeTree ())
1513
- .withType(paramType.translateFromRepeated(toArray = false ))
1514
- .withSpan(param.span.endPos)
1515
- )
1516
- val param1 = if isErased then param.withAddedFlags(Flags .Erased ) else param
1517
- cpy.ValDef (param1)(tpt = paramTpt)
1503
+ val (formal, isErased) = protoFormal(i)
1504
+ val param0 =
1505
+ if (! param.tpt.isEmpty) param
1506
+ else
1507
+ val knownFormal = isFullyDefined(formal, ForceDegree .failBottom)
1508
+ val paramType =
1509
+ if knownFormal then formal
1510
+ else inferredFromTarget(param, formal, calleeType, paramIndex)
1511
+ .orElse(errorType(AnonymousFunctionMissingParamType (param, tree, formal), param.srcPos))
1512
+ val paramTpt = untpd.TypedSplice (
1513
+ (if knownFormal then InferredTypeTree () else untpd.TypeTree ())
1514
+ .withType(paramType.translateFromRepeated(toArray = false ))
1515
+ .withSpan(param.span.endPos)
1516
+ )
1517
+ cpy.ValDef (param)(tpt = paramTpt)
1518
+ if isErased then param0.withAddedFlags(Flags .Erased ) else param0
1518
1519
desugared = desugar.makeClosure(inferredParams, fnBody, resultTpt, isContextual, tree.span)
1519
1520
1520
1521
typed(desugared, pt)
0 commit comments