Skip to content

Commit 07cd012

Browse files
committed
Drop redundant span computation
1 parent f708ee6 commit 07cd012

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,14 +1015,11 @@ object desugar {
10151015
* def $anonfun(params) = body
10161016
* Closure($anonfun)
10171017
*/
1018-
def makeClosure(params: List[ValDef], body: Tree, tpt: Tree = null, isContextual: Boolean)(implicit ctx: Context): Block = {
1019-
val span = params.headOption.fold(body.span)(_.span.union(body.span))
1018+
def makeClosure(params: List[ValDef], body: Tree, tpt: Tree = null, isContextual: Boolean)(implicit ctx: Context): Block =
10201019
Block(
10211020
DefDef(nme.ANON_FUN, Nil, params :: Nil, if (tpt == null) TypeTree() else tpt, body)
1022-
.withSpan(span)
10231021
.withMods(synthetic | Artifact),
1024-
Closure(Nil, Ident(nme.ANON_FUN), if (isContextual) ContextualEmptyTree else EmptyTree)).withSpan(span)
1025-
}
1022+
Closure(Nil, Ident(nme.ANON_FUN), if (isContextual) ContextualEmptyTree else EmptyTree))
10261023

10271024
/** If `nparams` == 1, expand partial function
10281025
*

0 commit comments

Comments
 (0)