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