File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ object Phases {
375
375
val doCheckJava = skipIfJava && ! isAfterLastJavaPhase
376
376
for unit <- units do ctx.profiler.onUnit(this , unit):
377
377
given unitCtx : Context = runCtx.fresh.setPhase(this .start).setCompilationUnit(unit).withRootImports
378
+ val previousTyperState = unitCtx.typerState.snapshot()
378
379
if ctx.run.enterUnit(unit) then
379
380
try
380
381
if doCheckJava && unit.typedAsJava then
@@ -384,6 +385,7 @@ object Phases {
384
385
buf += unitCtx.compilationUnit
385
386
catch
386
387
case _ : CompilationUnit .SuspendException => // this unit will be run again in `Run#compileSuspendedUnits`
388
+ unitCtx.typerState.resetTo(previousTyperState)
387
389
case ex : Throwable if ! ctx.run.enrichedErrorMessage =>
388
390
println(ctx.run.enrichErrorMessage(s " unhandled exception while running $phaseName on $unit" ))
389
391
throw ex
Original file line number Diff line number Diff line change
1
+ import scala .quoted .*
2
+
3
+ class Macro :
4
+ inline def nameTuple [NameTuple_T ]: (String , List [NameTuple_T ]) = Macro .tuple[NameTuple_T ](Macro .named)
5
+
6
+ object Macro :
7
+ def namedMacro (using q : Quotes ): Expr [String ] = Expr (" test" )
8
+ inline def named : String = $ {Macro .namedMacro}
9
+ def tuple [Tuple_T ](name : String ): (String , List [Tuple_T ]) = (name, List .empty[Tuple_T ])
Original file line number Diff line number Diff line change
1
+ class Test extends Macro :
2
+ val abc = nameTuple[Int ]
You can’t perform that action at this time.
0 commit comments