File tree 2 files changed +23
-1
lines changed
compiler/src/dotty/tools/dotc/transform
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._
26
26
import dotty .tools .dotc .transform .TreeMapWithStages ._
27
27
import dotty .tools .dotc .typer .Inliner
28
28
import dotty .tools .dotc .typer .ImportInfo .withRootImports
29
+ import dotty .tools .dotc .ast .TreeMapWithImplicits
29
30
30
31
import scala .annotation .constructorOnly
31
32
@@ -57,6 +58,11 @@ class Inlining extends MacroTransform {
57
58
58
59
protected def newTransformer (using Context ): Transformer = new Transformer {
59
60
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 = {
60
66
tree match
61
67
case tree : DefTree =>
62
68
if tree.symbol.is(Inline ) then tree
@@ -75,7 +81,7 @@ class Inlining extends MacroTransform {
75
81
super .transform(tree)(using StagingContext .spliceContext)
76
82
case _ =>
77
83
super .transform(tree)
78
-
84
+ }
79
85
}
80
86
}
81
87
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