diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-02-05 15:19:58 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-02-05 15:21:10 +0100 |
commit | 9e9206dbf3e1cbd378adcb9f65637d2cf331cc10 (patch) | |
tree | 4949c4c1f20e8e64b13bd4c0d0151d79effd2952 | |
parent | da7d7231b7f21fe1085abc569eb783590074a359 (diff) | |
download | dotty-9e9206dbf3e1cbd378adcb9f65637d2cf331cc10.tar.gz dotty-9e9206dbf3e1cbd378adcb9f65637d2cf331cc10.tar.bz2 dotty-9e9206dbf3e1cbd378adcb9f65637d2cf331cc10.zip |
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".
-rw-r--r-- | compiler/src/dotty/tools/dotc/ast/Positioned.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/Positioned.scala b/compiler/src/dotty/tools/dotc/ast/Positioned.scala index bb6817603..51949c6fe 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 } |