Skip to content

Commit 7cb80e6

Browse files
committed
Inline union method
1 parent ee23ff0 commit 7cb80e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/scala/scala/async/internal/AnfTransform.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ private[async] trait AnfTransform {
6565

6666
def listToBlock(trees: List[Tree]): Block = trees match {
6767
case trees @ (init :+ last) =>
68-
val pos = trees.map(_.pos).reduceLeft(_ union _)
68+
val pos = trees.map(_.pos).reduceLeft{
69+
(p, q) =>
70+
if (!q.isRange) p
71+
else if (p.isRange) p.withStart(p.start.min(q.start)).withEnd(p.end.max(q.end))
72+
else q
73+
}
6974
newBlock(init, last).setType(last.tpe).setPos(pos)
7075
}
7176

0 commit comments

Comments
 (0)