Skip to content

Commit 20ae6c1

Browse files
committed
Add comment
1 parent 98cf146 commit 20ae6c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
380380
case _ =>
381381
tpt
382382

383+
/** If one of `trees` is a spread of an expression that is not idempotent, lift out all
384+
* non-idempotent expressions (not just the spreads) and apply `within` to the resulting
385+
* pure references. Otherwise apply `within` to the original trees.
386+
*/
383387
private def evalSpreadsOnce(trees: List[Tree])(within: List[Tree] => Tree)(using Context): Tree =
384388
if trees.exists:
385389
case spread(elem) => !(exprPurity(elem) >= TreeInfo.Idempotent)

0 commit comments

Comments
 (0)