@@ -25,13 +25,11 @@ import scala.tasty.reflect.TypeTest
25
25
// NOTE: `ReflectionCompilerInterface` should be a class to make sure that all functionality of
26
26
// `CompilerInterface` is implemented here.
27
27
28
- class ReflectionCompilerInterface (val rootContext : Context ) extends CompilerInterface {
28
+ class ReflectionCompilerInterface (using val ctx : Context ) extends CompilerInterface {
29
29
import tpd ._
30
30
31
- private given core .Contexts .Context = rootContext
32
-
33
31
def rootPosition : util.SourcePosition =
34
- MacroExpansion .position.getOrElse(SourcePosition (rootContext .source, Spans .NoSpan ))
32
+ MacroExpansion .position.getOrElse(SourcePosition (ctx .source, Spans .NoSpan ))
35
33
36
34
37
35
// ////////////////////
@@ -45,26 +43,20 @@ class ReflectionCompilerInterface(val rootContext: Context) extends CompilerInte
45
43
PickledQuotes .unpickleType(repr, args)
46
44
47
45
48
- // ///////////
49
- // CONTEXT //
50
- // ///////////
51
-
52
- type Context = core.Contexts .Context
53
-
54
46
// ///////////////
55
47
// Constraints //
56
48
// ///////////////
57
49
58
50
59
51
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 )
62
54
63
55
def Constraints_add (syms : List [Symbol ]): Boolean =
64
- rootContext .gadt.addToConstraint(syms)
56
+ ctx .gadt.addToConstraint(syms)
65
57
66
58
def Constraints_approximation (sym : Symbol , fromBelow : Boolean ): Type =
67
- rootContext .gadt.approximation(sym, fromBelow)
59
+ ctx .gadt.approximation(sym, fromBelow)
68
60
69
61
// //////////
70
62
// Source //
@@ -2114,5 +2106,5 @@ class ReflectionCompilerInterface(val rootContext: Context) extends CompilerInte
2114
2106
private def withDefaultPos [T <: Tree ](tree : T ): T =
2115
2107
tree.withSpan(rootPosition.span)
2116
2108
2117
- def compilerId : Int = rootContext .outersIterator.toList.last.hashCode()
2109
+ def compilerId : Int = ctx .outersIterator.toList.last.hashCode()
2118
2110
}
0 commit comments