File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import dotty.tools.dotc.quoted._
2626import dotty .tools .dotc .transform .TreeMapWithStages ._
2727import dotty .tools .dotc .typer .Inliner
2828import dotty .tools .dotc .typer .ImportInfo .withRootImports
29+ import dotty .tools .dotc .ast .TreeMapWithImplicits
2930
3031import scala .annotation .constructorOnly
3132
@@ -57,6 +58,11 @@ class Inlining extends MacroTransform {
5758
5859 protected def newTransformer (using Context ): Transformer = new Transformer {
5960 override def transform (tree : tpd.Tree )(using Context ): tpd.Tree =
61+ new InliningTreeMap ().transform(tree)
62+ }
63+
64+ private class InliningTreeMap extends TreeMapWithImplicits {
65+ override def transform (tree : Tree )(using Context ): Tree = {
6066 tree match
6167 case tree : DefTree =>
6268 if tree.symbol.is(Inline ) then tree
@@ -75,7 +81,7 @@ class Inlining extends MacroTransform {
7581 super .transform(tree)(using StagingContext .spliceContext)
7682 case _ =>
7783 super .transform(tree)
78-
84+ }
7985 }
8086}
8187
Original file line number Diff line number Diff line change 1+
2+ import scala .quoted ._
3+ import scala .quoted .staging ._
4+
5+ object Test {
6+
7+ given Toolbox = Toolbox .make(getClass.getClassLoader)
8+
9+ def main (args : Array [String ]): Unit = run {
10+ ' {
11+ given Int = 10
12+ compiletime.summonInline[Int ]
13+ ()
14+ }
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments