Skip to content

Commit a8af838

Browse files
committed
Tpd: postpone unnecessary computations.
1 parent a32b5ca commit a8af838

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
474474

475475
override def Apply(tree: Tree)(fun: Tree, args: List[Tree])(implicit ctx: Context): Apply = {
476476
val untyped = untpd.cpy.Apply(tree)(fun, args)
477-
val typed = ta.assignType(untyped, fun, args)
478477
if (untyped.ne(tree))
479-
typed
478+
ta.assignType(untyped, fun, args)
480479
else
481480
tree.asInstanceOf[Apply]
482481
}
@@ -488,9 +487,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
488487

489488
override def TypeApply(tree: Tree)(fun: Tree, args: List[Tree])(implicit ctx: Context): TypeApply = {
490489
val untyped = untpd.cpy.TypeApply(tree)(fun, args)
491-
val typed = ta.assignType(untyped, fun, args)
492490
if (untyped.ne(tree))
493-
typed
491+
ta.assignType(untyped, fun, args)
494492
else
495493
tree.asInstanceOf[TypeApply]
496494

0 commit comments

Comments
 (0)