Skip to content

Commit de2c447

Browse files
authored
Merge pull request #1943 from dotty-staging/fix/lambda-position
Positioned#initialPos: Union the position of every children
2 parents 56ad4b1 + 9e9206d commit de2c447

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ abstract class Positioned extends DotClass with Product {
123123

124124
private def unionPos(pos: Position, xs: List[_]): Position = xs match {
125125
case (p: Positioned) :: xs1 => unionPos(pos union p.pos, xs1)
126+
case (xs0: List[_]) :: xs1 => unionPos(unionPos(pos, xs0), xs1)
127+
case _ :: xs1 => unionPos(pos, xs1)
126128
case _ => pos
127129
}
128130

0 commit comments

Comments
 (0)