aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Inliner.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-10-17 15:48:59 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-17 15:48:59 +0200
commit2fe0f674124c5be064d1cbf80594fb8e7d5d78be (patch)
treee7b9caf612964a8f418ac2cff778fa3078361583 /src/dotty/tools/dotc/typer/Inliner.scala
parente2ce0dbb695df7ebad37ab41d2dd264c63ee6b36 (diff)
downloaddotty-2fe0f674124c5be064d1cbf80594fb8e7d5d78be.tar.gz
dotty-2fe0f674124c5be064d1cbf80594fb8e7d5d78be.tar.bz2
dotty-2fe0f674124c5be064d1cbf80594fb8e7d5d78be.zip
Fix dropInlined to also change positions of subtrees
Diffstat (limited to 'src/dotty/tools/dotc/typer/Inliner.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Inliner.scala5
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))
}