We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98cf146 commit 20ae6c1Copy full SHA for 20ae6c1
compiler/src/dotty/tools/dotc/transform/PostTyper.scala
@@ -380,6 +380,10 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
380
case _ =>
381
tpt
382
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
+ */
387
private def evalSpreadsOnce(trees: List[Tree])(within: List[Tree] => Tree)(using Context): Tree =
388
if trees.exists:
389
case spread(elem) => !(exprPurity(elem) >= TreeInfo.Idempotent)
0 commit comments