Skip to content

Commit 36daa85

Browse files
committed
Try to rename QuoteContext to Quotes
This change is aimed to have shorter signatures. ```diff - def foo[T: Type](x: Expr[T])(using QuoteContext) = ... + def foo[T: Type](x: Expr[T])(using Quotes) = ... ``` It also seem to read better, "using quotes" which is exaclty what this contextual parameters indicates.
1 parent 2713a7e commit 36daa85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+247
-241
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ class Definitions {
794794
@tu lazy val QuotedExprClass: ClassSymbol = requiredClass("scala.quoted.Expr")
795795
@tu lazy val QuotedExprModule: Symbol = QuotedExprClass.companionModule
796796

797-
@tu lazy val QuoteContextClass: ClassSymbol = requiredClass("scala.quoted.QuoteContext")
797+
@tu lazy val QuotesClass: ClassSymbol = requiredClass("scala.quoted.Quotes")
798798

799799
@tu lazy val QuoteUnpicklerClass: ClassSymbol = requiredClass("scala.quoted.internal.QuoteUnpickler")
800800
@tu lazy val QuoteUnpickler_unpickleExpr: Symbol = QuoteUnpicklerClass.requiredMethod("unpickleExpr")

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ object StagingContext {
1717
private val QuotationLevel = new Property.Key[Int]
1818

1919
/** A key to be used in a context property that tracks the quoteation stack.
20-
* Stack containing the QuoteContext references recieved by the surrounding quotes.
20+
* Stack containing the Quotes references recieved by the surrounding quotes.
2121
*/
22-
private val QuoteContextStack = new Property.Key[List[tpd.Tree]]
22+
private val QuotesStack = new Property.Key[List[tpd.Tree]]
2323

2424
private val TaggedTypes = new Property.Key[PCPCheckAndHeal.QuoteTypeTags]
2525

@@ -31,11 +31,11 @@ object StagingContext {
3131
def quoteContext(using Context): Context =
3232
ctx.fresh.setProperty(QuotationLevel, level + 1)
3333

34-
/** Context with an incremented quotation level and pushes a refecence to a QuoteContext on the quote context stack */
35-
def pushQuoteContext(qctxRef: tpd.Tree)(using Context): Context =
36-
val old = ctx.property(QuoteContextStack).getOrElse(List.empty)
34+
/** Context with an incremented quotation level and pushes a refecence to a Quotes on the quote context stack */
35+
def pushQuotes(qctxRef: tpd.Tree)(using Context): Context =
36+
val old = ctx.property(QuotesStack).getOrElse(List.empty)
3737
ctx.fresh.setProperty(QuotationLevel, level + 1)
38-
.setProperty(QuoteContextStack, qctxRef :: old)
38+
.setProperty(QuotesStack, qctxRef :: old)
3939

4040
/** Context with a decremented quotation level. */
4141
def spliceContext(using Context): Context =
@@ -50,12 +50,12 @@ object StagingContext {
5050
/** Context with a decremented quotation level and pops the Some of top of the quote context stack or None if the stack is empty.
5151
* The quotation stack could be empty if we are in a top level splice or an eroneous splice directly witin a top level splice.
5252
*/
53-
def popQuoteContext()(using Context): (Option[tpd.Tree], Context) =
53+
def popQuotes()(using Context): (Option[tpd.Tree], Context) =
5454
val ctx1 = ctx.fresh.setProperty(QuotationLevel, level - 1)
5555
val head =
56-
ctx.property(QuoteContextStack) match
56+
ctx.property(QuotesStack) match
5757
case Some(x :: xs) =>
58-
ctx1.setProperty(QuoteContextStack, xs)
58+
ctx1.setProperty(QuotesStack, xs)
5959
Some(x)
6060
case _ =>
6161
None // Splice at level 0 or lower

compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import scala.io.Codec
99
import dotty.tools.dotc.core.Contexts._
1010
import dotty.tools.dotc.core.Phases.Phase
1111
import dotty.tools.dotc.core.tasty.TastyPrinter
12-
import dotty.tools.dotc.quoted.QuoteContextImpl
12+
import dotty.tools.dotc.quoted.QuotesImpl
1313
import dotty.tools.io.File
1414

1515
/** Phase that prints the trees in all loaded compilation units.
@@ -44,7 +44,7 @@ class DecompilationPrinter extends Phase {
4444
else {
4545
val unitFile = unit.source.toString.replace("\\", "/").replace(".class", ".tasty")
4646
out.println(s"/** Decompiled from $unitFile */")
47-
out.println(QuoteContextImpl.showDecompiledTree(unit.tpdTree))
47+
out.println(QuotesImpl.showDecompiledTree(unit.tpdTree))
4848
}
4949
}
5050
}

compiler/src/dotty/tools/dotc/decompiler/IDEDecompilerDriver.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import dotty.tools.dotc.core.Contexts._
66
import dotty.tools.dotc.core._
77
import dotty.tools.dotc.core.tasty.TastyHTMLPrinter
88
import dotty.tools.dotc.reporting._
9-
import dotty.tools.dotc.quoted.QuoteContextImpl
9+
import dotty.tools.dotc.quoted.QuotesImpl
1010

1111
/**
1212
* Decompiler to be used with IDEs
@@ -34,7 +34,7 @@ class IDEDecompilerDriver(val settings: List[String]) extends dotc.Driver {
3434
run.printSummary()
3535
val unit = ctx.run.units.head
3636

37-
val decompiled = QuoteContextImpl.showDecompiledTree(unit.tpdTree)
37+
val decompiled = QuotesImpl.showDecompiledTree(unit.tpdTree)
3838
val tree = new TastyHTMLPrinter(unit.pickled.head._2()).showContents()
3939

4040
reporter.removeBufferedMessages.foreach(message => System.err.println(message))

compiler/src/dotty/tools/dotc/quoted/Matcher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ import scala.quoted._
9797
*/
9898
object Matcher {
9999

100-
abstract class QuoteMatcher[QCtx <: QuoteContext & Singleton](val qctx: QCtx) {
100+
abstract class QuoteMatcher[QCtx <: Quotes & Singleton](val qctx: QCtx) {
101101

102102
// TODO improve performance
103103

compiler/src/dotty/tools/dotc/quoted/PickledQuotes.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import dotty.tools.dotc.report
1919

2020
import scala.reflect.ClassTag
2121

22-
import scala.quoted.QuoteContext
22+
import scala.quoted.Quotes
2323
import scala.collection.mutable
2424

2525
import QuoteUtils._
@@ -39,19 +39,19 @@ object PickledQuotes {
3939
/** Transform the expression into its fully spliced Tree */
4040
def quotedExprToTree[T](expr: quoted.Expr[T])(using Context): Tree = {
4141
val expr1 = expr.asInstanceOf[dotty.tools.dotc.quoted.ExprImpl]
42-
expr1.checkScopeId(QuoteContextImpl.scopeId)
42+
expr1.checkScopeId(QuotesImpl.scopeId)
4343
changeOwnerOfTree(expr1.tree, ctx.owner)
4444
}
4545

4646
/** Transform the expression into its fully spliced TypeTree */
4747
def quotedTypeToTree(tpe: quoted.Type[?])(using Context): Tree = {
4848
val tpe1 = tpe.asInstanceOf[dotty.tools.dotc.quoted.TypeImpl]
49-
tpe1.checkScopeId(QuoteContextImpl.scopeId)
49+
tpe1.checkScopeId(QuotesImpl.scopeId)
5050
changeOwnerOfTree(tpe1.typeTree, ctx.owner)
5151
}
5252

5353
/** Unpickle the tree contained in the TastyExpr */
54-
def unpickleTerm(pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.QuoteContext) => scala.quoted.Expr[?])(using Context): Tree = {
54+
def unpickleTerm(pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.Quotes) => scala.quoted.Expr[?])(using Context): Tree = {
5555
val unpickled = withMode(Mode.ReadPositions)(unpickle(pickled, isType = false))
5656
val Inlined(call, Nil, expnasion) = unpickled
5757
val inlineCtx = inlineContext(call)
@@ -61,22 +61,22 @@ object PickledQuotes {
6161
}
6262

6363
/** Unpickle the tree contained in the TastyType */
64-
def unpickleTypeTree(pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.QuoteContext) => scala.quoted.Expr[?])(using Context): Tree = {
64+
def unpickleTypeTree(pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.Quotes) => scala.quoted.Expr[?])(using Context): Tree = {
6565
val unpickled = withMode(Mode.ReadPositions)(unpickle(pickled, isType = true))
6666
spliceTypes(unpickled, typeHole, termHole)
6767
}
6868

6969
/** Replace all term holes with the spliced terms */
70-
private def spliceTerms(tree: Tree, typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.QuoteContext) => scala.quoted.Expr[?])(using Context): Tree = {
70+
private def spliceTerms(tree: Tree, typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.Quotes) => scala.quoted.Expr[?])(using Context): Tree = {
7171
val evaluateHoles = new TreeMap {
7272
override def transform(tree: tpd.Tree)(using Context): tpd.Tree = tree match {
7373
case Hole(isTerm, idx, args) =>
7474
val reifiedArgs = args.map { arg =>
75-
if (arg.isTerm) (using qctx: QuoteContext) => new dotty.tools.dotc.quoted.ExprImpl(arg, QuoteContextImpl.scopeId)
76-
else new dotty.tools.dotc.quoted.TypeImpl(arg, QuoteContextImpl.scopeId)
75+
if (arg.isTerm) (using qctx: Quotes) => new dotty.tools.dotc.quoted.ExprImpl(arg, QuotesImpl.scopeId)
76+
else new dotty.tools.dotc.quoted.TypeImpl(arg, QuotesImpl.scopeId)
7777
}
7878
if isTerm then
79-
val quotedExpr = termHole(idx, reifiedArgs, dotty.tools.dotc.quoted.QuoteContextImpl())
79+
val quotedExpr = termHole(idx, reifiedArgs, dotty.tools.dotc.quoted.QuotesImpl())
8080
val filled = PickledQuotes.quotedExprToTree(quotedExpr)
8181

8282
// We need to make sure a hole is created with the source file of the surrounding context, even if
@@ -121,7 +121,7 @@ object PickledQuotes {
121121
}
122122

123123
/** Replace all type holes generated with the spliced types */
124-
private def spliceTypes(tree: Tree, typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Int], scala.quoted.QuoteContext) => Any)(using Context): Tree = {
124+
private def spliceTypes(tree: Tree, typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Int], scala.quoted.Quotes) => Any)(using Context): Tree = {
125125
tree match
126126
case Block(stat :: rest, expr1) if stat.symbol.hasAnnotation(defn.InternalQuoted_SplicedTypeAnnot) =>
127127
val typeSpliceMap = (stat :: rest).iterator.map {

compiler/src/dotty/tools/dotc/quoted/QuoteContextImpl.scala renamed to compiler/src/dotty/tools/dotc/quoted/QuotesImpl.scala

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ import dotty.tools.dotc.quoted.reflect._
1313
import dotty.tools.dotc.quoted.QuoteUtils._
1414
import dotty.tools.dotc.core.Decorators._
1515

16-
import scala.quoted.QuoteContext
16+
import scala.quoted.Quotes
1717
import scala.quoted.internal.{QuoteUnpickler, QuoteMatching}
1818
import dotty.tools.dotc.quoted.printers.{Extractors, SourceCode, SyntaxHighlight}
1919

2020
import scala.tasty.reflect._
2121

22-
object QuoteContextImpl {
22+
object QuotesImpl {
2323

2424
type ScopeId = Int
2525

26-
def apply()(using Context): QuoteContext =
27-
new QuoteContextImpl(ctx)
26+
def apply()(using Context): Quotes =
27+
new QuotesImpl(ctx)
2828

2929
def showDecompiledTree(tree: tpd.Tree)(using Context): String = {
30-
val qctx: QuoteContextImpl = new QuoteContextImpl(MacroExpansion.context(tree))
30+
val qctx: QuotesImpl = new QuotesImpl(MacroExpansion.context(tree))
3131
if ctx.settings.color.value == "always" then
3232
qctx.reflect.TreeMethodsImpl.temporaryShowAnsiColored(tree)
3333
else
@@ -41,7 +41,7 @@ object QuoteContextImpl {
4141

4242
}
4343

44-
class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickler, QuoteMatching:
44+
class QuotesImpl private (ctx: Context) extends Quotes, QuoteUnpickler, QuoteMatching:
4545

4646
extension [T](self: scala.quoted.Expr[T]):
4747
def show: String =
@@ -55,7 +55,7 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
5555

5656
def asReflectTree: reflect.Term =
5757
val expr = self.asInstanceOf[ExprImpl]
58-
expr.checkScopeId(QuoteContextImpl.this.hashCode)
58+
expr.checkScopeId(QuotesImpl.this.hashCode)
5959
expr.tree
6060

6161
end extension
@@ -94,11 +94,11 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
9494
def pos: Position = self.sourcePos
9595
def symbol: Symbol = self.symbol
9696
def showExtractors: String =
97-
Extractors.showTree(using QuoteContextImpl.this)(self)
97+
Extractors.showTree(using QuotesImpl.this)(self)
9898
def show: String =
99-
SourceCode.showTree(using QuoteContextImpl.this)(self)(SyntaxHighlight.plain)
99+
SourceCode.showTree(using QuotesImpl.this)(self)(SyntaxHighlight.plain)
100100
def showAnsiColored: String =
101-
SourceCode.showTree(using QuoteContextImpl.this)(self)(SyntaxHighlight.ANSI)
101+
SourceCode.showTree(using QuotesImpl.this)(self)(SyntaxHighlight.ANSI)
102102
def isExpr: Boolean =
103103
self match
104104
case TermTypeTest(self) =>
@@ -108,15 +108,15 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
108108
case _ => false
109109
def asExpr: scala.quoted.Expr[Any] =
110110
if self.isExpr then
111-
new ExprImpl(self, QuoteContextImpl.this.hashCode)
111+
new ExprImpl(self, QuotesImpl.this.hashCode)
112112
else self match
113113
case TermTypeTest(self) => throw new Exception("Expected an expression. This is a partially applied Term. Try eta-expanding the term first.")
114114
case _ => throw new Exception("Expected a Term but was: " + self)
115115
end extension
116116

117117
extension [T](self: Tree)
118118
def asExprOf(using tp: scala.quoted.Type[T]): scala.quoted.Expr[T] =
119-
QuoteContextImpl.this.asExprOf[T](self.asExpr)(using tp)
119+
QuotesImpl.this.asExprOf[T](self.asExpr)(using tp)
120120
end extension
121121

122122
end TreeMethodsImpl
@@ -352,11 +352,11 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
352352
object TermMethodsImpl extends TermMethods:
353353
extension (self: Term):
354354
def seal: scala.quoted.Expr[Any] =
355-
if self.isExpr then new ExprImpl(self, QuoteContextImpl.this.hashCode)
355+
if self.isExpr then new ExprImpl(self, QuotesImpl.this.hashCode)
356356
else throw new Exception("Cannot seal a partially applied Term. Try eta-expanding the term first.")
357357

358358
def sealOpt: Option[scala.quoted.Expr[Any]] =
359-
if self.isExpr then Some(new ExprImpl(self, QuoteContextImpl.this.hashCode))
359+
if self.isExpr then Some(new ExprImpl(self, QuotesImpl.this.hashCode))
360360
else None
361361

362362
def tpe: TypeRepr = self.tpe
@@ -1634,18 +1634,18 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
16341634
object TypeReprMethodsImpl extends TypeReprMethods:
16351635
extension (self: TypeRepr):
16361636
def showExtractors: String =
1637-
Extractors.showType(using QuoteContextImpl.this)(self)
1637+
Extractors.showType(using QuotesImpl.this)(self)
16381638

16391639
def show: String =
1640-
SourceCode.showType(using QuoteContextImpl.this)(self)(SyntaxHighlight.plain)
1640+
SourceCode.showType(using QuotesImpl.this)(self)(SyntaxHighlight.plain)
16411641

16421642
def showAnsiColored: String =
1643-
SourceCode.showType(using QuoteContextImpl.this)(self)(SyntaxHighlight.ANSI)
1643+
SourceCode.showType(using QuotesImpl.this)(self)(SyntaxHighlight.ANSI)
16441644

16451645
def seal: scala.quoted.Type[_] = self.asType
16461646

16471647
def asType: scala.quoted.Type[?] =
1648-
new TypeImpl(Inferred(self), QuoteContextImpl.this.hashCode)
1648+
new TypeImpl(Inferred(self), QuotesImpl.this.hashCode)
16491649

16501650
def =:=(that: TypeRepr): Boolean = self =:= that
16511651
def <:<(that: TypeRepr): Boolean = self <:< that
@@ -2219,11 +2219,11 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
22192219
extension (self: Constant):
22202220
def value: Any = self.value
22212221
def showExtractors: String =
2222-
Extractors.showConstant(using QuoteContextImpl.this)(self)
2222+
Extractors.showConstant(using QuotesImpl.this)(self)
22232223
def show: String =
2224-
SourceCode.showConstant(using QuoteContextImpl.this)(self)(SyntaxHighlight.plain)
2224+
SourceCode.showConstant(using QuotesImpl.this)(self)(SyntaxHighlight.plain)
22252225
def showAnsiColored: String =
2226-
SourceCode.showConstant(using QuoteContextImpl.this)(self)(SyntaxHighlight.ANSI)
2226+
SourceCode.showConstant(using QuotesImpl.this)(self)(SyntaxHighlight.ANSI)
22272227
end extension
22282228
end ConstantMethodsImpl
22292229

@@ -2442,11 +2442,11 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
24422442
def children: List[Symbol] = self.denot.children
24432443

24442444
def showExtractors: String =
2445-
Extractors.showSymbol(using QuoteContextImpl.this)(self)
2445+
Extractors.showSymbol(using QuotesImpl.this)(self)
24462446
def show: String =
2447-
SourceCode.showSymbol(using QuoteContextImpl.this)(self)(SyntaxHighlight.plain)
2447+
SourceCode.showSymbol(using QuotesImpl.this)(self)(SyntaxHighlight.plain)
24482448
def showAnsiColored: String =
2449-
SourceCode.showSymbol(using QuoteContextImpl.this)(self)(SyntaxHighlight.ANSI)
2449+
SourceCode.showSymbol(using QuotesImpl.this)(self)(SyntaxHighlight.ANSI)
24502450

24512451
end extension
24522452

@@ -2578,11 +2578,11 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
25782578
def |(that: Flags): Flags = dotc.core.Flags.or(self, that) // TODO: Replace with dotc.core.Flags.|(self)(that) once extension names have stabilized
25792579
def &(that: Flags): Flags = dotc.core.Flags.and(self, that)// TODO: Replace with dotc.core.Flags.&(self)(that) once extension names have stabilized
25802580
def showExtractors: String =
2581-
Extractors.showFlags(using QuoteContextImpl.this)(self)
2581+
Extractors.showFlags(using QuotesImpl.this)(self)
25822582
def show: String =
2583-
SourceCode.showFlags(using QuoteContextImpl.this)(self)(SyntaxHighlight.plain)
2583+
SourceCode.showFlags(using QuotesImpl.this)(self)(SyntaxHighlight.plain)
25842584
def showAnsiColored: String =
2585-
SourceCode.showFlags(using QuoteContextImpl.this)(self)(SyntaxHighlight.ANSI)
2585+
SourceCode.showFlags(using QuotesImpl.this)(self)(SyntaxHighlight.ANSI)
25862586
end extension
25872587
end FlagsMethodsImpl
25882588

@@ -2658,18 +2658,18 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
26582658

26592659
end reflect
26602660

2661-
def unpickleExpr[T](pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.QuoteContext) => scala.quoted.Expr[?]): scala.quoted.Expr[T] =
2661+
def unpickleExpr[T](pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.Quotes) => scala.quoted.Expr[?]): scala.quoted.Expr[T] =
26622662
val tree = PickledQuotes.unpickleTerm(pickled, typeHole, termHole)(using reflect.rootContext)
26632663
new ExprImpl(tree, hash).asInstanceOf[scala.quoted.Expr[T]]
26642664

2665-
def unpickleType[T <: AnyKind](pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.QuoteContext) => scala.quoted.Expr[?]): scala.quoted.Type[T] =
2665+
def unpickleType[T <: AnyKind](pickled: String | List[String], typeHole: (Int, Seq[Any]) => scala.quoted.Type[?], termHole: (Int, Seq[Any], scala.quoted.Quotes) => scala.quoted.Expr[?]): scala.quoted.Type[T] =
26662666
val tree = PickledQuotes.unpickleTypeTree(pickled, typeHole, termHole)(using reflect.rootContext)
26672667
new TypeImpl(tree, hash).asInstanceOf[scala.quoted.Type[T]]
26682668

26692669
object ExprMatch extends ExprMatchModule:
26702670
def unapply[TypeBindings <: Tuple, Tup <: Tuple](scrutinee: scala.quoted.Expr[Any])(using pattern: scala.quoted.Expr[Any]): Option[Tup] =
2671-
val scrutineeTree = QuoteContextImpl.this.asReflectTree(scrutinee)
2672-
val patternTree = QuoteContextImpl.this.asReflectTree(pattern)
2671+
val scrutineeTree = QuotesImpl.this.asReflectTree(scrutinee)
2672+
val patternTree = QuotesImpl.this.asReflectTree(pattern)
26732673
treeMatch(scrutineeTree, patternTree).asInstanceOf[Option[Tup]]
26742674
end ExprMatch
26752675

@@ -2708,7 +2708,7 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
27082708
ctx1.gadt.addToConstraint(typeHoles)
27092709
ctx1
27102710

2711-
val qctx1 = dotty.tools.dotc.quoted.QuoteContextImpl()(using ctx1)
2711+
val qctx1 = dotty.tools.dotc.quoted.QuotesImpl()(using ctx1)
27122712

27132713
val matcher = new Matcher.QuoteMatcher[qctx1.type](qctx1) {
27142714
def patternHoleSymbol: qctx1.reflect.Symbol = dotc.core.Symbols.defn.InternalQuotedPatterns_patternHole.asInstanceOf
@@ -2732,7 +2732,7 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
27322732
}
27332733
}
27342734

2735-
private[this] val hash = QuoteContextImpl.scopeId(using ctx)
2735+
private[this] val hash = QuotesImpl.scopeId(using ctx)
27362736
override def hashCode: Int = hash
27372737

2738-
end QuoteContextImpl
2738+
end QuotesImpl

compiler/src/dotty/tools/dotc/quoted/TypeImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class TypeImpl(val typeTree: tpd.Tree, val scopeId: Int) extends scala.quo
1515
}
1616

1717
/** View this expression `quoted.Type[T]` as a `TypeTree` */
18-
def unseal(using qctx: QuoteContext): qctx.reflect.TypeTree =
18+
def unseal(using qctx: Quotes): qctx.reflect.TypeTree =
1919
checkScopeId(qctx.hashCode)
2020
typeTree.asInstanceOf[qctx.reflect.TypeTree]
2121

0 commit comments

Comments
 (0)