Skip to content

Commit db8a1eb

Browse files
Merge pull request #6121 from dotty-staging/fix-#6015
Fix #6015: Transform inner missing trees
2 parents b213f24 + 66f248f commit db8a1eb

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ object Inliner {
160160
case tree: Ident => finalize(tree, untpd.Ident(tree.name)(curSource))
161161
case tree: Literal => finalize(tree, untpd.Literal(tree.const)(curSource))
162162
case tree: This => finalize(tree, untpd.This(tree.qual)(curSource))
163-
case tree: JavaSeqLiteral => finalize(tree, untpd.JavaSeqLiteral(tree.elems, tree.elemtpt)(curSource))
164-
case tree: SeqLiteral => finalize(tree, untpd.SeqLiteral(tree.elems, tree.elemtpt)(curSource))
163+
case tree: JavaSeqLiteral => finalize(tree, untpd.JavaSeqLiteral(transform(tree.elems), transform(tree.elemtpt))(curSource))
164+
case tree: SeqLiteral => finalize(tree, untpd.SeqLiteral(transform(tree.elems), transform(tree.elemtpt))(curSource))
165165
case tree: TypeTree => tpd.TypeTree(tree.tpe)(ctx.withSource(curSource)).withSpan(tree.span)
166-
case tree: Bind => finalize(tree, untpd.Bind(tree.name, tree.body)(curSource))
166+
case tree: Bind => finalize(tree, untpd.Bind(tree.name, transform(tree.body))(curSource))
167167
case _ => super.transform(tree)
168168
})
169169
assert(transformed.isInstanceOf[EmptyTree[_]] || transformed.isInstanceOf[EmptyValDef[_]] || transformed.source == curSource)

tests/pos/i6015.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import scala.compiletime._
2+
3+
object Test {
4+
implicit val i: Int = 23
5+
6+
inline def foo() = {
7+
Array[Int](implicitly[Int])
8+
}
9+
10+
foo()
11+
}

0 commit comments

Comments
 (0)