File tree Expand file tree Collapse file tree 8 files changed +46
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 8 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class Driver {
3737 val run = compiler.newRun
3838 run.compile(fileNames)
3939
40- def finish (run : Run ): Unit =
40+ def finish (run : Run )( using Context ) : Unit =
4141 run.printSummary()
4242 if ! ctx.reporter.errorsReported && run.suspendedUnits.nonEmpty then
4343 val suspendedUnits = run.suspendedUnits.toList
@@ -46,7 +46,7 @@ class Driver {
4646 val run1 = compiler.newRun
4747 for unit <- suspendedUnits do unit.suspended = false
4848 run1.compileUnits(suspendedUnits)
49- finish(run1)
49+ finish(run1)( using MacroClassLoader .init(ctx.fresh))
5050
5151 finish(run)
5252 catch
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ object C {
4+ inline def m : Any = $ { mExpr }
5+ def mExpr (using qctx : QuoteContext ): Expr [Any ] = Expr (1 )
6+ }
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ object L {
4+ val m = C .m
5+ }
6+
7+ class LC
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ object Q {
4+ inline def f (): Any = $ { fExpr }
5+ def fExpr (using QuoteContext ): Expr [Any ] = { new LC ; Expr (1 ) }
6+ }
Original file line number Diff line number Diff line change 1+ object Test extends App {
2+ Q .f()
3+ }
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ object C {
4+ inline def m : Any = $ { mExpr }
5+ def mExpr (using qctx : QuoteContext ): Expr [Any ] = ' { () }
6+ }
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ object Q {
4+ inline def f (inline f : Any ): Any = $ { Q2 .fExpr(' f ) }
5+ }
6+
7+ object Q2 {
8+ val m = C .m
9+ def fExpr (f : Expr [Any ])(using QuoteContext ): Expr [Any ] = ' { () }
10+ }
Original file line number Diff line number Diff line change 1+ class TopLevelClass {
2+ Q .f(1 )
3+ }
4+
5+ val a = 1
6+ val b = Q .f(a)
You can’t perform that action at this time.
0 commit comments