Skip to content

Commit 6e4e353

Browse files
committed
Replace scala.quoted.Type.$splice with T
1 parent f4f3304 commit 6e4e353

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ class Definitions {
710710
@tu lazy val InternalQuotedType_unapply: Symbol = InternalQuotedTypeModule.requiredMethod(nme.unapply)
711711

712712
@tu lazy val QuotedTypeClass: ClassSymbol = ctx.requiredClass("scala.quoted.Type")
713-
@tu lazy val QuotedType_splice: Symbol = QuotedTypeClass.requiredType(tpnme.splice)
713+
@tu lazy val QuotedType_splice: Symbol = QuotedTypeClass.requiredType(tpnme.spliceType)
714714

715715
@tu lazy val QuotedTypeModule: Symbol = QuotedTypeClass.companionModule
716716

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ object StdNames {
578578
val setSymbol: N = "setSymbol"
579579
val setType: N = "setType"
580580
val setTypeSignature: N = "setTypeSignature"
581-
val splice: N = "$splice"
581+
val spliceType: N = "T"
582582
val standardInterpolator: N = "standardInterpolator"
583583
val staticClass : N = "staticClass"
584584
val staticModule : N = "staticModule"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,13 @@ object PCPCheckAndHeal {
270270

271271
private def mkTagSymbolAndAssignType(spliced: TermRef): TypeDef = {
272272
val splicedTree = tpd.ref(spliced).withSpan(span)
273-
val rhs = splicedTree.select(tpnme.splice).withSpan(span)
273+
val rhs = splicedTree.select(tpnme.spliceType).withSpan(span)
274274
val alias = ctx.typeAssigner.assignType(untpd.TypeBoundsTree(rhs, rhs), rhs, rhs, EmptyTree)
275275
val local = ctx.newSymbol(
276276
owner = ctx.owner,
277277
name = UniqueName.fresh((splicedTree.symbol.name.toString + "$_").toTermName).toTypeName,
278278
flags = Synthetic,
279-
info = TypeAlias(splicedTree.tpe.select(tpnme.splice)),
279+
info = TypeAlias(splicedTree.tpe.select(tpnme.spliceType)),
280280
coord = span).asType
281281
local.addAnnotation(Annotation(defn.InternalQuoted_QuoteTypeTagAnnot))
282282
ctx.typeAssigner.assignType(untpd.TypeDef(local.name, alias), local)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class ReifyQuotes extends MacroTransform {
370370
case tree: RefTree if isCaptured(tree.symbol, level) =>
371371
val body = capturers(tree.symbol).apply(tree)
372372
if (tree.isType)
373-
transformSpliceType(body, body.select(tpnme.splice))
373+
transformSpliceType(body, body.select(tpnme.spliceType))
374374
else
375375
val splice = ref(defn.InternalQuoted_exprSplice).appliedToType(tree.tpe).appliedTo(body).asInstanceOf[Apply]
376376
transformSplice(body, splice)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ trait QuotesAndSplices {
170170
typeSym.addAnnotation(Annotation(New(ref(defn.InternalQuotedMatcher_patternTypeAnnot.typeRef)).withSpan(tree.expr.span)))
171171
val pat = typedPattern(tree.expr, defn.QuotedTypeClass.typeRef.appliedTo(typeSym.typeRef))(
172172
using spliceContext.retractMode(Mode.QuotedPattern).withOwner(spliceOwner(ctx)))
173-
pat.select(tpnme.splice)
173+
pat.select(tpnme.spliceType)
174174
else
175-
typedSelect(untpd.Select(tree.expr, tpnme.splice), pt)(using spliceContext).withSpan(tree.span)
175+
typedSelect(untpd.Select(tree.expr, tpnme.spliceType), pt)(using spliceContext).withSpan(tree.span)
176176
}
177177

178178
private def checkSpliceOutsideQuote(tree: untpd.Tree)(using Context): Unit =

library/src-bootstrapped/scala/quoted/Type.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package scala.quoted
33
import scala.quoted.show.SyntaxHighlight
44

55
/** Quoted type (or kind) `T` */
6-
abstract class Type[T <: AnyKind] private[scala] {
7-
type `$splice` = T
6+
abstract class Type[X <: AnyKind] private[scala] {
7+
type T = X
88

99
/** Show a source code like representation of this type without syntax highlight */
1010
def show(using qctx: QuoteContext): String =

0 commit comments

Comments
 (0)