@@ -25,13 +25,11 @@ import scala.tasty.reflect.TypeTest
2525// NOTE: `ReflectionCompilerInterface` should be a class to make sure that all functionality of
2626// `CompilerInterface` is implemented here.
2727
28- class ReflectionCompilerInterface (val rootContext : Context ) extends CompilerInterface {
28+ class ReflectionCompilerInterface (using val ctx : Context ) extends CompilerInterface {
2929 import tpd ._
3030
31- private given core .Contexts .Context = rootContext
32-
3331 def rootPosition : util.SourcePosition =
34- MacroExpansion .position.getOrElse(SourcePosition (rootContext .source, Spans .NoSpan ))
32+ MacroExpansion .position.getOrElse(SourcePosition (ctx .source, Spans .NoSpan ))
3533
3634
3735 // ////////////////////
@@ -45,26 +43,20 @@ class ReflectionCompilerInterface(val rootContext: Context) extends CompilerInte
4543 PickledQuotes .unpickleType(repr, args)
4644
4745
48- // ///////////
49- // CONTEXT //
50- // ///////////
51-
52- type Context = core.Contexts .Context
53-
5446 // ///////////////
5547 // Constraints //
5648 // ///////////////
5749
5850
5951 def Constraints_context [T ]: scala.quoted.QuoteContext =
60- val ctx = rootContext .fresh.setFreshGADTBounds.addMode(Mode .GadtConstraintInference )
61- dotty.tools.dotc.quoted.QuoteContextImpl ()(using ctx )
52+ val ctx1 = ctx .fresh.setFreshGADTBounds.addMode(Mode .GadtConstraintInference )
53+ dotty.tools.dotc.quoted.QuoteContextImpl ()(using ctx1 )
6254
6355 def Constraints_add (syms : List [Symbol ]): Boolean =
64- rootContext .gadt.addToConstraint(syms)
56+ ctx .gadt.addToConstraint(syms)
6557
6658 def Constraints_approximation (sym : Symbol , fromBelow : Boolean ): Type =
67- rootContext .gadt.approximation(sym, fromBelow)
59+ ctx .gadt.approximation(sym, fromBelow)
6860
6961 // //////////
7062 // Source //
@@ -2114,5 +2106,5 @@ class ReflectionCompilerInterface(val rootContext: Context) extends CompilerInte
21142106 private def withDefaultPos [T <: Tree ](tree : T ): T =
21152107 tree.withSpan(rootPosition.span)
21162108
2117- def compilerId : Int = rootContext .outersIterator.toList.last.hashCode()
2109+ def compilerId : Int = ctx .outersIterator.toList.last.hashCode()
21182110}
0 commit comments