@@ -1942,15 +1942,15 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
19421942 val resultTpt =
19431943 untpd.InLambdaTypeTree (isResult = true , (tsyms, vsyms) =>
19441944 mt.resultType.substParams(mt, vsyms.map(_.termRef)).substParams(poly, tsyms.map(_.typeRef)))
1945- val desugared @ Block ( List (defdef), _) = desugar.makeClosure(tparams, inferredVParams, body, resultTpt, tree.span)
1945+ val desugared = desugar.makeClosure(tparams, inferredVParams, body, resultTpt, tree.span)
19461946 typed(desugared, pt)
19471947 else
19481948 val msg =
19491949 em """ |Provided polymorphic function value doesn't match the expected type $dpt.
19501950 |Expected type should be a polymorphic function with the same number of type and value parameters. """
19511951 errorTree(EmptyTree , msg, tree.srcPos)
19521952 case _ =>
1953- val desugared @ Block ( List (defdef), _) = desugar.makeClosure(tparams, vparams, body, untpd.TypeTree (), tree.span)
1953+ val desugared = desugar.makeClosure(tparams, vparams, body, untpd.TypeTree (), tree.span)
19541954 typed(desugared, pt)
19551955 end typedPolyFunctionValue
19561956
@@ -3578,17 +3578,17 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
35783578 case xtree => typedUnnamed(xtree)
35793579
35803580 val unsimplifiedType = result.tpe
3581- val result1 = simplify(result, pt, locked)
3582- result1 .tpe.stripTypeVar match
3581+ simplify(result, pt, locked)
3582+ result .tpe.stripTypeVar match
35833583 case e : ErrorType if ! unsimplifiedType.isErroneous => errorTree(xtree, e.msg, xtree.srcPos)
3584- case _ => result1
3584+ case _ => result
35853585 catch case ex : TypeError =>
35863586 handleTypeError(ex)
35873587 }
35883588 }
35893589
35903590 /** Interpolate and simplify the type of the given tree. */
3591- protected def simplify (tree : Tree , pt : Type , locked : TypeVars )(using Context ): Tree =
3591+ protected def simplify (tree : Tree , pt : Type , locked : TypeVars )(using Context ): tree. type =
35923592 if ! tree.denot.isOverloaded then // for overloaded trees: resolve overloading before simplifying
35933593 if ! tree.tpe.widen.isInstanceOf [MethodOrPoly ] // wait with simplifying until method is fully applied
35943594 || tree.isDef // ... unless tree is a definition
0 commit comments