File tree 3 files changed +13
-2
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -304,8 +304,9 @@ object Inliner {
304
304
*/
305
305
def inlineCallTrace (callSym : Symbol , pos : SourcePosition )(using Context ): Tree = {
306
306
assert(ctx.source == pos.source)
307
- if (callSym.is(Macro )) ref(callSym.topLevelClass.owner).select(callSym.topLevelClass.name).withSpan(pos.span)
308
- else Ident (callSym.topLevelClass.typeRef).withSpan(pos.span)
307
+ val topLevelCls = callSym.topLevelClass
308
+ if (callSym.is(Macro )) ref(topLevelCls.owner).select(topLevelCls.name)(using ctx.withOwner(topLevelCls.owner)).withSpan(pos.span)
309
+ else Ident (topLevelCls.typeRef).withSpan(pos.span)
309
310
}
310
311
311
312
object Intrinsics {
Original file line number Diff line number Diff line change
1
+ package mylib
2
+ import scala .quoted .*
3
+
4
+ private [mylib] object Main :
5
+ transparent inline def d (): Unit = $ {interpMacro}
6
+ def interpMacro (using Quotes ) : Expr [Unit ] = ' {}
7
+
8
+ transparent inline def f (): Unit = Main .d()
Original file line number Diff line number Diff line change
1
+ import mylib .*
2
+ val x = f()
You can’t perform that action at this time.
0 commit comments