Skip to content

Commit 963fdbd

Browse files
committed
Remove QuoteContext.macroContext
This was an old context that was synthesized for macros before we used implicit function types within splices to provide the context.
1 parent 407f9b4 commit 963fdbd

File tree

5 files changed

+0
-23
lines changed

5 files changed

+0
-23
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,6 @@ class Definitions {
645645
@tu lazy val QuotedExprModule_unitExpr: Symbol = QuotedExprModule.requiredMethod(nme.unitExpr)
646646

647647
@tu lazy val QuoteContextClass: ClassSymbol = ctx.requiredClass("scala.quoted.QuoteContext")
648-
@tu lazy val QuoteContextModule: Symbol = QuoteContextClass.companionModule
649-
@tu lazy val QuoteContext_macroContext: Symbol = QuoteContextModule.requiredMethod("macroContext")
650648

651649
@tu lazy val LiftableModule: Symbol = ctx.requiredModule("scala.quoted.Liftable")
652650
@tu lazy val LiftableModule_BooleanIsLiftable: Symbol = LiftableModule.requiredMethod("BooleanIsLiftable")

compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
192192
case Some(l) =>
193193
l == level ||
194194
level == -1 && (
195-
sym == defn.QuoteContext_macroContext ||
196195
// here we assume that Splicer.canBeSpliced was true before going to level -1,
197196
// this implies that all non-inline arguments are quoted and that the following two cases are checked
198197
// on inline parameters or type parameters.

compiler/src/dotty/tools/dotc/transform/Splicer.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ object Splicer {
9898
case Literal(Constant(value)) =>
9999
// OK
100100

101-
case _ if tree.symbol == defn.QuoteContext_macroContext =>
102-
// OK
103-
104101
case Call(fn, args)
105102
if (fn.symbol.isConstructor && fn.symbol.owner.owner.is(Package)) ||
106103
fn.symbol.is(Module) || fn.symbol.isStatic ||
@@ -191,9 +188,6 @@ object Splicer {
191188
case Literal(Constant(value)) =>
192189
interpretLiteral(value)
193190

194-
case _ if tree.symbol == defn.QuoteContext_macroContext =>
195-
interpretQuoteContext()
196-
197191
// TODO disallow interpreted method calls as arguments
198192
case Call(fn, args) =>
199193
if (fn.symbol.isConstructor && fn.symbol.owner.owner.is(Package))
@@ -263,9 +257,6 @@ object Splicer {
263257
private def interpretVarargs(args: List[Object])(implicit env: Env): Object =
264258
args.toSeq
265259

266-
private def interpretQuoteContext()(implicit env: Env): Object =
267-
QuoteContext()
268-
269260
private def interpretedStaticMethodCall(moduleClass: Symbol, fn: Symbol)(implicit env: Env): List[Object] => Object = {
270261
val (inst, clazz) =
271262
if (moduleClass.name.startsWith(str.REPL_SESSION_LINE))

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,6 @@ trait Implicits { self: Typer =>
732732
}
733733
}
734734

735-
lazy val synthesizedQuoteContext: SpecialHandler =
736-
(formal, span) => implicit ctx =>
737-
if (ctx.inMacro || enclosingInlineds.nonEmpty) ref(defn.QuoteContext_macroContext)
738-
else EmptyTree
739-
740735
lazy val synthesizedTupleFunction: SpecialHandler =
741736
(formal, span) => implicit ctx => formal match {
742737
case AppliedType(_, funArgs @ fun :: tupled :: Nil) =>
@@ -1082,7 +1077,6 @@ trait Implicits { self: Typer =>
10821077
mySpecialHandlers = List(
10831078
defn.ClassTagClass -> synthesizedClassTag,
10841079
defn.QuotedTypeClass -> synthesizedTypeTag,
1085-
defn.QuoteContextClass -> synthesizedQuoteContext,
10861080
defn.EqlClass -> synthesizedEq,
10871081
defn.TupledFunctionClass -> synthesizedTupleFunction,
10881082
defn.ValueOfClass -> synthesizedValueOf,
@@ -1464,7 +1458,6 @@ trait Implicits { self: Typer =>
14641458
case alt1: SearchSuccess =>
14651459
var diff = compareCandidate(alt1, alt2.ref, alt2.level)
14661460
assert(diff <= 0) // diff > 0 candidates should already have been eliminated in `rank`
1467-
14681461
if diff == 0 then
14691462
// Fall back: if both results are extension method applications,
14701463
// compare the extension methods instead of their wrappers.

library/src/scala/quoted/QuoteContext.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,3 @@ class QuoteContext(val tasty: scala.tasty.Reflection) {
4747
}
4848

4949
}
50-
51-
object QuoteContext {
52-
def macroContext: QuoteContext = throw new Exception("Not in inline macro.")
53-
}

0 commit comments

Comments
 (0)