From 9e9206dbf3e1cbd378adcb9f65637d2cf331cc10 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sun, 5 Feb 2017 15:19:58 +0100 Subject: [PATCH] Positioned#initialPos: Union the position of every children Previously we missed some children, one consequence of this is that the position of the typed tree corresponding to the lambda "z => 1" did not contain the position of "z". --- compiler/src/dotty/tools/dotc/ast/Positioned.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/ast/Positioned.scala b/compiler/src/dotty/tools/dotc/ast/Positioned.scala index bb68176037a5..51949c6fefb5 100644 --- a/compiler/src/dotty/tools/dotc/ast/Positioned.scala +++ b/compiler/src/dotty/tools/dotc/ast/Positioned.scala @@ -123,6 +123,8 @@ abstract class Positioned extends DotClass with Product { private def unionPos(pos: Position, xs: List[_]): Position = xs match { case (p: Positioned) :: xs1 => unionPos(pos union p.pos, xs1) + case (xs0: List[_]) :: xs1 => unionPos(unionPos(pos, xs0), xs1) + case _ :: xs1 => unionPos(pos, xs1) case _ => pos }