We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee23ff0 commit 7cb80e6Copy full SHA for 7cb80e6
src/main/scala/scala/async/internal/AnfTransform.scala
@@ -65,7 +65,12 @@ private[async] trait AnfTransform {
65
66
def listToBlock(trees: List[Tree]): Block = trees match {
67
case trees @ (init :+ last) =>
68
- val pos = trees.map(_.pos).reduceLeft(_ union _)
+ 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
+ }
74
newBlock(init, last).setType(last.tpe).setPos(pos)
75
}
76
0 commit comments