diff options
author | Martin Odersky <odersky@gmail.com> | 2016-10-17 15:48:59 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-17 15:48:59 +0200 |
commit | 2fe0f674124c5be064d1cbf80594fb8e7d5d78be (patch) | |
tree | e7b9caf612964a8f418ac2cff778fa3078361583 | |
parent | e2ce0dbb695df7ebad37ab41d2dd264c63ee6b36 (diff) | |
download | dotty-2fe0f674124c5be064d1cbf80594fb8e7d5d78be.tar.gz dotty-2fe0f674124c5be064d1cbf80594fb8e7d5d78be.tar.bz2 dotty-2fe0f674124c5be064d1cbf80594fb8e7d5d78be.zip |
Fix dropInlined to also change positions of subtrees
-rw-r--r-- | src/dotty/tools/dotc/typer/Inliner.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Inliner.scala b/src/dotty/tools/dotc/typer/Inliner.scala index 55008c0c5..40c1ca350 100644 --- a/src/dotty/tools/dotc/typer/Inliner.scala +++ b/src/dotty/tools/dotc/typer/Inliner.scala @@ -244,8 +244,9 @@ object Inliner { /** Replace `Inlined` node by a block that contains its bindings and expansion */ def dropInlined(inlined: tpd.Inlined)(implicit ctx: Context): Tree = { val reposition = new TreeMap { - override def transform(tree: Tree)(implicit ctx: Context): Tree = - tree.withPos(inlined.call.pos) + override def transform(tree: Tree)(implicit ctx: Context): Tree = { + super.transform(tree).withPos(inlined.call.pos) + } } tpd.seq(inlined.bindings, reposition.transform(inlined.expansion)) } |