Skip to content

Commit 082edca

Browse files
Merge pull request #7408 from lampepfl/revert-7404-disambiguate-quoted-type-and-reflection-type
Revert "Disambiguate quoted and tasty Type"
2 parents 4719e7b + bf349b3 commit 082edca

File tree

157 files changed

+464
-672
lines changed

Some content is hidden

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

157 files changed

+464
-672
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ object desugar {
292292
}
293293
}
294294

295-
/** Transforms a definition with a name starting with a `$` in a quoted pattern into a `scala.quoted.binding.Binding` splice.
295+
/** Transforms a definition with a name starting with a `$` in a quoted pattern into a `quoted.binding.Binding` splice.
296296
*
297297
* The desugaring consists in adding the `@patternBindHole` annotation. This annotation is used during typing to perform the full transformation.
298298
*

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
12071207
/** An extractor for typed splices */
12081208
object Splice {
12091209
def apply(tree: Tree)(implicit ctx: Context): Tree = {
1210-
val baseType = tree.tpe.baseType(defn.QuotedExprClass).orElse(tree.tpe.baseType(defn.QuotedTypeTagClass))
1210+
val baseType = tree.tpe.baseType(defn.QuotedExprClass).orElse(tree.tpe.baseType(defn.QuotedTypeClass))
12111211
val argType =
12121212
if (baseType != NoType) baseType.argTypesHi.head
12131213
else defn.NothingType

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,13 +659,13 @@ class Definitions {
659659
@tu lazy val InternalQuotedExprModule: Symbol = ctx.requiredModule("scala.internal.quoted.Expr")
660660
@tu lazy val InternalQuotedExpr_unapply: Symbol = InternalQuotedExprModule.requiredMethod(nme.unapply)
661661

662-
@tu lazy val InternalQuotedTypeTagModule: Symbol = ctx.requiredModule("scala.internal.quoted.TypeTag")
663-
@tu lazy val InternalQuotedTypeTag_unapply: Symbol = InternalQuotedTypeTagModule.requiredMethod(nme.unapply)
662+
@tu lazy val InternalQuotedTypeModule: Symbol = ctx.requiredModule("scala.internal.quoted.Type")
663+
@tu lazy val InternalQuotedType_unapply: Symbol = InternalQuotedTypeModule.requiredMethod(nme.unapply)
664664

665-
@tu lazy val QuotedTypeTagClass: ClassSymbol = ctx.requiredClass("scala.quoted.TypeTag")
666-
@tu lazy val QuotedTypeTag_splice: Symbol = QuotedTypeTagClass.requiredType(tpnme.splice)
665+
@tu lazy val QuotedTypeClass: ClassSymbol = ctx.requiredClass("scala.quoted.Type")
666+
@tu lazy val QuotedType_splice: Symbol = QuotedTypeClass.requiredType(tpnme.splice)
667667

668-
@tu lazy val QuotedTypeTagModule: Symbol = QuotedTypeTagClass.companionModule
668+
@tu lazy val QuotedTypeModule: Symbol = QuotedTypeClass.companionModule
669669

670670
@tu lazy val QuotedMatchingSymClass: ClassSymbol = ctx.requiredClass("scala.quoted.matching.Sym")
671671
@tu lazy val TastyReflectionClass: ClassSymbol = ctx.requiredClass("scala.tasty.Reflection")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ object PickledQuotes {
3535
}
3636

3737
/** Transform the expression into its fully spliced Tree */
38-
def quotedExprToTree[T](expr: scala.quoted.Expr[T])(implicit ctx: Context): Tree = {
38+
def quotedExprToTree[T](expr: quoted.Expr[T])(implicit ctx: Context): Tree = {
3939
val expr1 = expr.asInstanceOf[TastyTreeExpr[Tree]]
4040
QuoteContext.checkScopeId(expr1.scopeId)
4141
healOwner(expr1.tree)
4242
}
4343

4444
/** Transform the expression into its fully spliced TypeTree */
45-
def quotedTypeToTree(tpe: scala.quoted.TypeTag[?])(implicit ctx: Context): Tree = {
45+
def quotedTypeToTree(tpe: quoted.Type[?])(implicit ctx: Context): Tree = {
4646
val tpe1 = tpe.asInstanceOf[TreeType[Tree]]
4747
QuoteContext.checkScopeId(tpe1.scopeId)
4848
healOwner(tpe1.typeTree)

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ class TreeUnpickler(reader: TastyReader,
12751275
else new TreeType(arg, QuoteContext.scopeId)
12761276
val reifiedArgs = args.map(wrap)
12771277
val filled = if (isType) {
1278-
val quotedType = splice.asInstanceOf[Seq[Any] => scala.quoted.TypeTag[?]](reifiedArgs)
1278+
val quotedType = splice.asInstanceOf[Seq[Any] => quoted.Type[?]](reifiedArgs)
12791279
PickledQuotes.quotedTypeToTree(quotedType)
12801280
}
12811281
else {

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
374374
else if (name.isTypeName) typeText(txt)
375375
else txt
376376
case tree @ Select(qual, name) =>
377-
if (!printDebug && tree.hasType && tree.symbol == defn.QuotedTypeTag_splice) typeText("${") ~ toTextLocal(qual) ~ typeText("}")
377+
if (!printDebug && tree.hasType && tree.symbol == defn.QuotedType_splice) typeText("${") ~ toTextLocal(qual) ~ typeText("}")
378378
else if (qual.isType) toTextLocal(qual) ~ "#" ~ typeText(toText(name))
379379
else toTextLocal(qual) ~ ("." ~ nameIdText(tree) provided (name != nme.CONSTRUCTOR || printDebug))
380380
case tree: This =>
@@ -499,7 +499,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
499499
if (lo eq hi) optText(lo)(" = " ~ _)
500500
else optText(lo)(" >: " ~ _) ~ optText(hi)(" <: " ~ _)
501501
case Bind(name, body) =>
502-
keywordText("given ").provided(tree.symbol.isOneOf(GivenOrImplicit) && !homogenizedView) ~ // Used for scala.quoted.TypeTag in quote patterns (not pickled)
502+
keywordText("given ").provided(tree.symbol.isOneOf(GivenOrImplicit) && !homogenizedView) ~ // Used for scala.quoted.Type in quote patterns (not pickled)
503503
changePrec(InfixPrec) { toText(name) ~ " @ " ~ toText(body) }
504504
case Alternative(trees) =>
505505
changePrec(OrPrec) { toText(trees, " | ") }

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionCompilerInterface.scala

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import dotty.tools.dotc.util.{SourceFile, SourcePosition, Spans}
1818
import scala.runtime.quoted.Unpickler
1919
import scala.tasty.reflect.CompilerInterface
2020

21-
import scala.quoted.{Expr, TypeTag}
22-
2321
class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extends CompilerInterface {
2422
import tpd._
2523

@@ -34,10 +32,10 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
3432
// QUOTE UNPICKLING
3533
//
3634

37-
def unpickleExpr(repr: Unpickler.PickledQuote, args: Unpickler.PickledExprArgs): Expr[?] =
35+
def unpickleExpr(repr: Unpickler.PickledQuote, args: Unpickler.PickledExprArgs): scala.quoted.Expr[?] =
3836
new scala.internal.quoted.TastyTreeExpr(PickledQuotes.unpickleExpr(repr, args), compilerId)
3937

40-
def unpickleType(repr: Unpickler.PickledQuote, args: Unpickler.PickledTypeArgs): TypeTag[?] =
38+
def unpickleType(repr: Unpickler.PickledQuote, args: Unpickler.PickledTypeArgs): scala.quoted.Type[?] =
4139
new scala.internal.quoted.TreeType(PickledQuotes.unpickleType(repr, args), compilerId)
4240

4341
//
@@ -1582,16 +1580,16 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
15821580
// QUOTED SEAL/UNSEAL
15831581
//
15841582

1585-
/** View this expression `scala.quoted.Expr[?]` as a `Term` */
1586-
def QuotedExpr_unseal(self: Expr[?])(given Context): Term =
1583+
/** View this expression `quoted.Expr[?]` as a `Term` */
1584+
def QuotedExpr_unseal(self: scala.quoted.Expr[?])(given Context): Term =
15871585
PickledQuotes.quotedExprToTree(self)
15881586

1589-
/** View this expression `scala.quoted.TypeTag[?]` as a `TypeTree` */
1590-
def QuotedType_unseal(self: TypeTag[?])(given Context): TypeTree =
1587+
/** View this expression `quoted.Type[?]` as a `TypeTree` */
1588+
def QuotedType_unseal(self: scala.quoted.Type[?])(given Context): TypeTree =
15911589
PickledQuotes.quotedTypeToTree(self)
15921590

1593-
/** Convert `Term` to an `scala.quoted.Expr[Any]` */
1594-
def QuotedExpr_seal(self: Term)(given ctx: Context): Expr[Any] = {
1591+
/** Convert `Term` to an `quoted.Expr[Any]` */
1592+
def QuotedExpr_seal(self: Term)(given ctx: Context): scala.quoted.Expr[Any] = {
15951593
def etaExpand(term: Term): Term = term.tpe.widen match {
15961594
case mtpe: Types.MethodType if !mtpe.isParamDependent =>
15971595
val closureResType = mtpe.resType match {
@@ -1606,12 +1604,12 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
16061604
new scala.internal.quoted.TastyTreeExpr(etaExpand(self), compilerId)
16071605
}
16081606

1609-
/** Checked cast to a `scala.quoted.Expr[U]` */
1610-
def QuotedExpr_cast[U](self: Expr[?])(given tp: TypeTag[U], ctx: Context): Expr[U] = {
1607+
/** Checked cast to a `quoted.Expr[U]` */
1608+
def QuotedExpr_cast[U](self: scala.quoted.Expr[?])(given tp: scala.quoted.Type[U], ctx: Context): scala.quoted.Expr[U] = {
16111609
val tree = QuotedExpr_unseal(self)
1612-
val expectedType = QuotedType_unseal(tp.asInstanceOf[TypeTag[U]]).tpe
1610+
val expectedType = QuotedType_unseal(tp).tpe
16131611
if (tree.tpe <:< expectedType)
1614-
self.asInstanceOf[Expr[U]]
1612+
self.asInstanceOf[scala.quoted.Expr[U]]
16151613
else
16161614
throw new scala.tasty.reflect.ExprCastError(
16171615
s"""Expr: ${tree.show}
@@ -1620,8 +1618,8 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
16201618
)
16211619
}
16221620

1623-
/** Convert `Type` to an `scala.quoted.TypeTag[?]` */
1624-
def QuotedType_seal(self: Type)(given ctx: Context): TypeTag[?] = {
1621+
/** Convert `Type` to an `quoted.Type[?]` */
1622+
def QuotedType_seal(self: Type)(given ctx: Context): scala.quoted.Type[?] = {
16251623
val dummySpan = ctx.owner.span // FIXME
16261624
new scala.internal.quoted.TreeType(tpd.TypeTree(self).withSpan(dummySpan), compilerId)
16271625
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
8282
* that are phase-incorrect can still be healed as follows:
8383
*
8484
* If `T` is a reference to a type at the wrong level, try to heal it by replacing it with
85-
* `${implicitly[scala.quoted.TypeTag[T]]}`.
85+
* `${implicitly[quoted.Type[T]]}`.
8686
*/
8787
protected def checkLevel(tree: Tree)(implicit ctx: Context): Tree = {
8888
def checkTp(tp: Type): Type = checkType(tree.sourcePos).apply(tp)
@@ -123,8 +123,8 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
123123
if (tp.isTerm)
124124
ctx.error(i"splice outside quotes", pos)
125125
tp
126-
case tp: TypeRef if tp.symbol == defn.QuotedTypeTagClass.typeParams.head =>
127-
// Adapt direct references to the type of the type parameter T of a scala.quoted.TypeTag[T].
126+
case tp: TypeRef if tp.symbol == defn.QuotedTypeClass.typeParams.head =>
127+
// Adapt direct references to the type of the type parameter T of a quoted.Type[T].
128128
// Replace it with a properly encoded type splice. This is the normal for expected for type splices.
129129
tp.prefix.select(tpnme.splice)
130130
case tp: NamedType =>
@@ -147,7 +147,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
147147
* by which we refer to `sym`. If it is an inconsistent type try construct a healed type for it.
148148
*
149149
* @return `None` if the phase is correct or cannot be healed
150-
* `Some(tree)` with the `tree` of the healed type tree for `${implicitly[scala.quoted.TypeTag[T]]}`
150+
* `Some(tree)` with the `tree` of the healed type tree for `${implicitly[quoted.Type[T]]}`
151151
*/
152152
private def checkSymLevel(sym: Symbol, tp: Type, pos: SourcePosition)(implicit ctx: Context): Option[Tree] = {
153153
/** Is a reference to a class but not `this.type` */
@@ -196,7 +196,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
196196
None
197197
}
198198
else {
199-
val reqType = defn.QuotedTypeTagClass.typeRef.appliedTo(tp)
199+
val reqType = defn.QuotedTypeClass.typeRef.appliedTo(tp)
200200
val tag = ctx.typer.inferImplicitArg(reqType, pos.span)
201201
tag.tpe match {
202202
case _: TermRef =>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,15 @@ class ReifyQuotes extends MacroTransform {
229229
if (isType) ref(defn.Unpickler_unpickleType).appliedToType(originalTp)
230230
else ref(defn.Unpickler_unpickleExpr).appliedToType(originalTp.widen)
231231
val spliceResType =
232-
if (isType) defn.QuotedTypeTagClass.typeRef.appliedTo(WildcardType)
233-
else defn.FunctionType(1, isContextual = true).appliedTo(defn.QuoteContextClass.typeRef, defn.QuotedExprClass.typeRef.appliedTo(defn.AnyType)) | defn.QuotedTypeTagClass.typeRef.appliedTo(WildcardType)
232+
if (isType) defn.QuotedTypeClass.typeRef.appliedTo(WildcardType)
233+
else defn.FunctionType(1, isContextual = true).appliedTo(defn.QuoteContextClass.typeRef, defn.QuotedExprClass.typeRef.appliedTo(defn.AnyType)) | defn.QuotedTypeClass.typeRef.appliedTo(WildcardType)
234234
val pickledQuoteStrings = liftList(PickledQuotes.pickleQuote(body).map(x => Literal(Constant(x))), defn.StringType)
235235
val splicesList = liftList(splices, defn.FunctionType(1).appliedTo(defn.SeqType.appliedTo(defn.AnyType), spliceResType))
236236
meth.appliedTo(pickledQuoteStrings, splicesList)
237237
}
238238

239239
if (isType) {
240-
def tag(tagName: String) = ref(defn.QuotedTypeTagModule).select(tagName.toTermName).appliedTo(qctx)
240+
def tag(tagName: String) = ref(defn.QuotedTypeModule).select(tagName.toTermName).appliedTo(qctx)
241241
if (splices.isEmpty && body.symbol.isPrimitiveValueClass) tag(s"${body.symbol.name}Tag")
242242
else pickleAsTasty().select(nme.apply).appliedTo(qctx)
243243
}
@@ -311,7 +311,7 @@ class ReifyQuotes extends MacroTransform {
311311
}
312312
assert(tpw.isInstanceOf[ValueType])
313313
val argTpe =
314-
if (tree.isType) defn.QuotedTypeTagClass.typeRef.appliedTo(tpw)
314+
if (tree.isType) defn.QuotedTypeClass.typeRef.appliedTo(tpw)
315315
else defn.FunctionType(1, isContextual = true).appliedTo(defn.QuoteContextClass.typeRef, defn.QuotedExprClass.typeRef.appliedTo(tpw))
316316
val selectArg = arg.select(nme.apply).appliedTo(Literal(Constant(i))).cast(argTpe)
317317
val capturedArg = SyntheticValDef(UniqueName.fresh(tree.symbol.name.toTermName).toTermName, selectArg)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ class Staging extends MacroTransform {
6363
}
6464

6565
tree.tpe match {
66-
case tpe @ TypeRef(prefix, _) if tpe.typeSymbol eq defn.QuotedTypeTag_splice =>
66+
case tpe @ TypeRef(prefix, _) if tpe.typeSymbol eq defn.QuotedType_splice =>
6767
// Type splices must have a know term ref, usually to an implicit argument
68-
// This is mostly intended to catch `scala.quoted.TypeTag[T]#splice` types which should just be `T`
68+
// This is mostly intended to catch `quoted.Type[T]#splice` types which should just be `T`
6969
assert(prefix.isInstanceOf[TermRef] || prefix.isInstanceOf[ThisType], prefix)
7070
case _ =>
7171
// OK

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,5 +213,5 @@ class SymUtils(val self: Symbol) extends AnyVal {
213213

214214
/** Is symbol a splice operation? */
215215
def isSplice(implicit ctx: Context): Boolean =
216-
self == defn.InternalQuoted_exprSplice || self == defn.QuotedTypeTag_splice
216+
self == defn.InternalQuoted_exprSplice || self == defn.QuotedType_splice
217217
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ trait Implicits { self: Typer =>
705705
EmptyTree
706706
}
707707

708-
/** Synthesize the tree for `'[T]` for an implicit `scala.quoted.TypeTag[T]`.
708+
/** Synthesize the tree for `'[T]` for an implicit `scala.quoted.Type[T]`.
709709
* `T` is deeply dealiased to avoid references to local type aliases.
710710
*/
711711
lazy val synthesizedTypeTag: SpecialHandler = {
@@ -1076,7 +1076,7 @@ trait Implicits { self: Typer =>
10761076
if (mySpecialHandlers == null)
10771077
mySpecialHandlers = List(
10781078
defn.ClassTagClass -> synthesizedClassTag,
1079-
defn.QuotedTypeTagClass -> synthesizedTypeTag,
1079+
defn.QuotedTypeClass -> synthesizedTypeTag,
10801080
defn.QuoteContextClass -> synthesizedQuoteContext,
10811081
defn.EqlClass -> synthesizedEq,
10821082
defn.TupledFunctionClass -> synthesizedTupleFunction,

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ trait QuotesAndSplices {
3232

3333
import tpd._
3434

35-
/** Translate `'{ t }` into `scala.quoted.Expr.apply(t)` and `'[T]` into `scala.quoted.TypeTag.apply[T]`
35+
/** Translate `'{ t }` into `scala.quoted.Expr.apply(t)` and `'[T]` into `scala.quoted.Type.apply[T]`
3636
* while tracking the quotation level in the context.
3737
*/
3838
def typedQuote(tree: untpd.Quote, pt: Type)(implicit ctx: Context): Tree = {
@@ -113,7 +113,7 @@ trait QuotesAndSplices {
113113
}
114114
val typeSym = ctx.newSymbol(spliceOwner(ctx), name, EmptyFlags, TypeBounds.empty, NoSymbol, tree.expr.span)
115115
typeSym.addAnnotation(Annotation(New(ref(defn.InternalQuoted_patternBindHoleAnnot.typeRef)).withSpan(tree.expr.span)))
116-
val pat = typedPattern(tree.expr, defn.QuotedTypeTagClass.typeRef.appliedTo(typeSym.typeRef))(
116+
val pat = typedPattern(tree.expr, defn.QuotedTypeClass.typeRef.appliedTo(typeSym.typeRef))(
117117
spliceContext.retractMode(Mode.QuotedPattern).withOwner(spliceOwner(ctx)))
118118
pat.select(tpnme.splice)
119119
}
@@ -190,7 +190,7 @@ trait QuotesAndSplices {
190190
val pat1 = if (patType eq patType1) pat else pat.withType(patType1)
191191
patBuf += pat1
192192
}
193-
case Select(pat, _) if tree.symbol == defn.QuotedTypeTag_splice =>
193+
case Select(pat, _) if tree.symbol == defn.QuotedType_splice =>
194194
val sym = tree.tpe.dealias.typeSymbol.asType
195195
val tdef = TypeDef(sym).withSpan(sym.span)
196196
freshTypeBindingsBuff += transformTypeBindingTypeDef(tdef, freshTypePatBuf)
@@ -232,7 +232,7 @@ trait QuotesAndSplices {
232232
if (variance == -1)
233233
tdef.symbol.addAnnotation(Annotation(New(ref(defn.InternalQuoted_fromAboveAnnot.typeRef)).withSpan(tdef.span)))
234234
val bindingType = getBinding(tdef.symbol).symbol.typeRef
235-
val bindingTypeTpe = AppliedType(defn.QuotedTypeTagClass.typeRef, bindingType :: Nil)
235+
val bindingTypeTpe = AppliedType(defn.QuotedTypeClass.typeRef, bindingType :: Nil)
236236
assert(tdef.name.startsWith("$"))
237237
val bindName = tdef.name.toString.stripPrefix("$").toTermName
238238
val sym = ctx0.newPatternBoundSymbol(bindName, bindingTypeTpe, tdef.span, flags = ImplicitTerm)
@@ -254,7 +254,7 @@ trait QuotesAndSplices {
254254
val isFreshTypeBindings = freshTypeBindings.map(_.symbol).toSet
255255
val typeMap = new TypeMap() {
256256
def apply(tp: Type): Type = tp match {
257-
case tp: TypeRef if tp.typeSymbol == defn.QuotedTypeTag_splice =>
257+
case tp: TypeRef if tp.typeSymbol == defn.QuotedType_splice =>
258258
val tp1 = tp.dealias
259259
if (isFreshTypeBindings(tp1.typeSymbol)) tp1
260260
else tp
@@ -331,7 +331,7 @@ trait QuotesAndSplices {
331331
class ReplaceBindings extends TypeMap() {
332332
override def apply(tp: Type): Type = tp match {
333333
case tp: TypeRef =>
334-
val tp1 = if (tp.typeSymbol == defn.QuotedTypeTag_splice) tp.dealias else tp
334+
val tp1 = if (tp.typeSymbol == defn.QuotedType_splice) tp.dealias else tp
335335
typeBindings.get(tp1.typeSymbol).fold(tp)(_.symbol.typeRef)
336336
case tp => mapOver(tp)
337337
}
@@ -364,8 +364,8 @@ trait QuotesAndSplices {
364364

365365
val splicePat = typed(untpd.Tuple(splices.map(x => untpd.TypedSplice(replaceBindingsInTree.transform(x)))).withSpan(quoted.span), patType)
366366

367-
val unapplySym = if (tree.quoted.isTerm) defn.InternalQuotedExpr_unapply else defn.InternalQuotedTypeTag_unapply
368-
val quoteClass = if (tree.quoted.isTerm) defn.QuotedExprClass else defn.QuotedTypeTagClass
367+
val unapplySym = if (tree.quoted.isTerm) defn.InternalQuotedExpr_unapply else defn.InternalQuotedType_unapply
368+
val quoteClass = if (tree.quoted.isTerm) defn.QuotedExprClass else defn.QuotedTypeClass
369369
val quotedPattern =
370370
if (tree.quoted.isTerm) ref(defn.InternalQuoted_exprQuote.termRef).appliedToType(defn.AnyType).appliedTo(shape).select(nme.apply).appliedTo(qctx)
371371
else ref(defn.InternalQuoted_typeQuote.termRef).appliedToTypeTrees(shape :: Nil)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
scala> val a = '[Int]
2-
val a: quoted.TypeTag[Int] = TypeTag(Int)
2+
val a: quoted.Type[Int] = Type(Int)
33
scala> '[Int]
4-
val res0: quoted.TypeTag[Int] = TypeTag(Int)
4+
val res0: quoted.Type[Int] = Type(Int)
55
scala> '[Int]; '[Int]
6-
val res1: quoted.TypeTag[Int] = TypeTag(Int)
7-
val res2: quoted.TypeTag[Int] = TypeTag(Int)
6+
val res1: quoted.Type[Int] = Type(Int)
7+
val res2: quoted.Type[Int] = Type(Int)

0 commit comments

Comments
 (0)