File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed
compiler/src/dotty/tools/dotc/inlines Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1067,6 +1067,8 @@ class Inliner(val call: tpd.Tree)(using Context):
1067
1067
tree match {
1068
1068
case tree : RefTree if tree.isTerm && level == - 1 && tree.symbol.isDefinedInCurrentRun && ! tree.symbol.isLocal =>
1069
1069
foldOver(tree.symbol :: syms, tree)
1070
+ case _ : This if level == - 1 && tree.symbol.isDefinedInCurrentRun =>
1071
+ tree.symbol :: syms
1070
1072
case _ : TypTree => syms
1071
1073
case _ => foldOver(syms, tree)
1072
1074
}
Original file line number Diff line number Diff line change
1
+ package user
2
+
3
+ import defn .Macro
4
+
5
+ object Inline extends Macro {
6
+ inline def callMacro (): Int =
7
+ $ { this .impl() }
8
+ }
Original file line number Diff line number Diff line change
1
+ package defn
2
+
3
+ import scala .quoted .*
4
+
5
+ abstract class Macro {
6
+ def impl ()(using Quotes ): Expr [Int ] = ' {1 }
7
+ }
Original file line number Diff line number Diff line change
1
+ package user
2
+
3
+ object Test {
4
+ Inline .callMacro()
5
+ }
You can’t perform that action at this time.
0 commit comments