From 66f248fd9ec014a503539dd3d28d19c18a488f5b Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 19 Mar 2019 17:52:51 +0100 Subject: [PATCH] Fix #6015: Transform inner missing trees --- compiler/src/dotty/tools/dotc/typer/Inliner.scala | 6 +++--- tests/pos/i6015.scala | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 tests/pos/i6015.scala diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index d0f0cdbb772c..807942194640 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -160,10 +160,10 @@ object Inliner { case tree: Ident => finalize(tree, untpd.Ident(tree.name)(curSource)) case tree: Literal => finalize(tree, untpd.Literal(tree.const)(curSource)) case tree: This => finalize(tree, untpd.This(tree.qual)(curSource)) - case tree: JavaSeqLiteral => finalize(tree, untpd.JavaSeqLiteral(tree.elems, tree.elemtpt)(curSource)) - case tree: SeqLiteral => finalize(tree, untpd.SeqLiteral(tree.elems, tree.elemtpt)(curSource)) + case tree: JavaSeqLiteral => finalize(tree, untpd.JavaSeqLiteral(transform(tree.elems), transform(tree.elemtpt))(curSource)) + case tree: SeqLiteral => finalize(tree, untpd.SeqLiteral(transform(tree.elems), transform(tree.elemtpt))(curSource)) case tree: TypeTree => tpd.TypeTree(tree.tpe)(ctx.withSource(curSource)).withSpan(tree.span) - case tree: Bind => finalize(tree, untpd.Bind(tree.name, tree.body)(curSource)) + case tree: Bind => finalize(tree, untpd.Bind(tree.name, transform(tree.body))(curSource)) case _ => super.transform(tree) }) assert(transformed.isInstanceOf[EmptyTree[_]] || transformed.isInstanceOf[EmptyValDef[_]] || transformed.source == curSource) diff --git a/tests/pos/i6015.scala b/tests/pos/i6015.scala new file mode 100644 index 000000000000..337aaf8bfdea --- /dev/null +++ b/tests/pos/i6015.scala @@ -0,0 +1,11 @@ +import scala.compiletime._ + +object Test { + implicit val i: Int = 23 + + inline def foo() = { + Array[Int](implicitly[Int]) + } + + foo() +}