Skip to content

Commit 3a045c4

Browse files
committed
Rename QuotedExpr to Quote and SplicedExpr to Splice
1 parent c6adab8 commit 3a045c4

25 files changed

+116
-116
lines changed

compiler/src/dotty/tools/dotc/CompilationUnit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ object CompilationUnit {
157157
if tree.symbol.is(Flags.Inline) then
158158
containsInline = true
159159
tree match
160-
case tpd.QuotedExpr(_, _) =>
160+
case tpd.Quote(_, _) =>
161161
containsQuote = true
162162
case tree: tpd.Apply if tree.symbol == defn.QuotedTypeModule_of =>
163163
containsQuote = true

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ object desugar {
338338
def quotedPattern(tree: untpd.Tree, expectedTpt: untpd.Tree)(using Context): untpd.Tree = {
339339
def adaptToExpectedTpt(tree: untpd.Tree): untpd.Tree = tree match {
340340
// Add the expected type as an ascription
341-
case _: untpd.SplicedExpr =>
341+
case _: untpd.Splice =>
342342
untpd.Typed(tree, expectedTpt).withSpan(tree.span)
343-
case Typed(expr: untpd.SplicedExpr, tpt) =>
343+
case Typed(expr: untpd.Splice, tpt) =>
344344
cpy.Typed(tree)(expr, untpd.makeAndType(tpt, expectedTpt).withSpan(tpt.span))
345345

346346
// Propagate down the expected type to the leafs of the expression
@@ -1986,10 +1986,10 @@ object desugar {
19861986
trees foreach collect
19871987
case Block(Nil, expr) =>
19881988
collect(expr)
1989-
case QuotedExpr(expr, _) =>
1989+
case Quote(expr, _) =>
19901990
new UntypedTreeTraverser {
19911991
def traverse(tree: untpd.Tree)(using Context): Unit = tree match {
1992-
case SplicedExpr(expr, _) => collect(expr)
1992+
case Splice(expr, _) => collect(expr)
19931993
case _ => traverseChildren(tree)
19941994
}
19951995
}.traverse(expr)

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -677,14 +677,14 @@ object Trees {
677677
override def isType = expansion.isType
678678
}
679679

680-
case class QuotedExpr[+T <: Untyped] private[ast] (expr: Tree[T], tpt: Tree[T])(implicit @constructorOnly src: SourceFile)
680+
case class Quote[+T <: Untyped] private[ast] (expr: Tree[T], tpt: Tree[T])(implicit @constructorOnly src: SourceFile)
681681
extends TermTree[T] {
682-
type ThisTree[+T <: Untyped] = QuotedExpr[T]
682+
type ThisTree[+T <: Untyped] = Quote[T]
683683
}
684684

685-
case class SplicedExpr[+T <: Untyped] private[ast] (expr: Tree[T], tpt: Tree[T])(implicit @constructorOnly src: SourceFile)
685+
case class Splice[+T <: Untyped] private[ast] (expr: Tree[T], tpt: Tree[T])(implicit @constructorOnly src: SourceFile)
686686
extends TermTree[T] {
687-
type ThisTree[+T <: Untyped] = SplicedExpr[T]
687+
type ThisTree[+T <: Untyped] = Splice[T]
688688
def isInBraces: Boolean = span.end != expr.span.end
689689
}
690690

@@ -1098,8 +1098,8 @@ object Trees {
10981098
type SeqLiteral = Trees.SeqLiteral[T]
10991099
type JavaSeqLiteral = Trees.JavaSeqLiteral[T]
11001100
type Inlined = Trees.Inlined[T]
1101-
type QuotedExpr = Trees.QuotedExpr[T]
1102-
type SplicedExpr = Trees.SplicedExpr[T]
1101+
type Quote = Trees.Quote[T]
1102+
type Splice = Trees.Splice[T]
11031103
type TypeTree = Trees.TypeTree[T]
11041104
type InferredTypeTree = Trees.InferredTypeTree[T]
11051105
type SingletonTypeTree = Trees.SingletonTypeTree[T]
@@ -1270,13 +1270,13 @@ object Trees {
12701270
case tree: Inlined if (call eq tree.call) && (bindings eq tree.bindings) && (expansion eq tree.expansion) => tree
12711271
case _ => finalize(tree, untpd.Inlined(call, bindings, expansion)(sourceFile(tree)))
12721272
}
1273-
def QuotedExpr(tree: Tree)(expr: Tree, tpt: Tree)(using Context): QuotedExpr = tree match {
1274-
case tree: QuotedExpr if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
1275-
case _ => finalize(tree, untpd.QuotedExpr(expr, tpt)(sourceFile(tree)))
1273+
def Quote(tree: Tree)(expr: Tree, tpt: Tree)(using Context): Quote = tree match {
1274+
case tree: Quote if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
1275+
case _ => finalize(tree, untpd.Quote(expr, tpt)(sourceFile(tree)))
12761276
}
1277-
def SplicedExpr(tree: Tree)(expr: Tree, tpt: Tree)(using Context): SplicedExpr = tree match {
1278-
case tree: SplicedExpr if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
1279-
case _ => finalize(tree, untpd.SplicedExpr(expr, tpt)(sourceFile(tree)))
1277+
def Splice(tree: Tree)(expr: Tree, tpt: Tree)(using Context): Splice = tree match {
1278+
case tree: Splice if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
1279+
case _ => finalize(tree, untpd.Splice(expr, tpt)(sourceFile(tree)))
12801280
}
12811281
def SingletonTypeTree(tree: Tree)(ref: Tree)(using Context): SingletonTypeTree = tree match {
12821282
case tree: SingletonTypeTree if (ref eq tree.ref) => tree
@@ -1383,8 +1383,8 @@ object Trees {
13831383
TypeDef(tree: Tree)(name, rhs)
13841384
def Template(tree: Template)(using Context)(constr: DefDef = tree.constr, parents: List[Tree] = tree.parents, derived: List[untpd.Tree] = tree.derived, self: ValDef = tree.self, body: LazyTreeList = tree.unforcedBody): Template =
13851385
Template(tree: Tree)(constr, parents, derived, self, body)
1386-
def SplicedExpr(tree: SplicedExpr)(expr: Tree = tree.expr, tpt: Tree = tree.tpt)(using Context): SplicedExpr =
1387-
SplicedExpr(tree: Tree)(expr, tpt)
1386+
def Splice(tree: Splice)(expr: Tree = tree.expr, tpt: Tree = tree.tpt)(using Context): Splice =
1387+
Splice(tree: Tree)(expr, tpt)
13881388
def Hole(tree: Hole)(isTerm: Boolean = tree.isTerm, idx: Int = tree.idx, args: List[Tree] = tree.args, content: Tree = tree.content, tpt: Tree = tree.tpt)(using Context): Hole =
13891389
Hole(tree: Tree)(isTerm, idx, args, content, tpt)
13901390

@@ -1517,10 +1517,10 @@ object Trees {
15171517
case Thicket(trees) =>
15181518
val trees1 = transform(trees)
15191519
if (trees1 eq trees) tree else Thicket(trees1)
1520-
case tree @ QuotedExpr(expr, tpt) =>
1521-
cpy.QuotedExpr(tree)(transform(expr), transform(tpt))
1522-
case tree @ SplicedExpr(expr, tpt) =>
1523-
cpy.SplicedExpr(tree)(transform(expr), transform(tpt))
1520+
case tree @ Quote(expr, tpt) =>
1521+
cpy.Quote(tree)(transform(expr), transform(tpt))
1522+
case tree @ Splice(expr, tpt) =>
1523+
cpy.Splice(tree)(transform(expr), transform(tpt))
15241524
case tree @ Hole(_, _, args, content, tpt) =>
15251525
cpy.Hole(tree)(args = transform(args), content = transform(content), tpt = transform(tpt))
15261526
case _ =>
@@ -1662,9 +1662,9 @@ object Trees {
16621662
this(this(x, arg), annot)
16631663
case Thicket(ts) =>
16641664
this(x, ts)
1665-
case QuotedExpr(expr, tpt) =>
1665+
case Quote(expr, tpt) =>
16661666
this(this(x, expr), tpt)
1667-
case SplicedExpr(expr, tpt) =>
1667+
case Splice(expr, tpt) =>
16681668
this(this(x, expr), tpt)
16691669
case Hole(_, _, args, content, tpt) =>
16701670
this(this(this(x, args), content), tpt)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
170170
def Inlined(call: Tree, bindings: List[MemberDef], expansion: Tree)(using Context): Inlined =
171171
ta.assignType(untpd.Inlined(call, bindings, expansion), bindings, expansion)
172172

173-
def QuotedExpr(expr: Tree, tpt: Tree)(using Context): QuotedExpr =
174-
ta.assignType(untpd.QuotedExpr(expr, tpt), tpt)
173+
def Quote(expr: Tree, tpt: Tree)(using Context): Quote =
174+
ta.assignType(untpd.Quote(expr, tpt), tpt)
175175

176-
def SplicedExpr(expr: Tree, tpt: Tree)(using Context): SplicedExpr =
177-
ta.assignType(untpd.SplicedExpr(expr, tpt), tpt)
176+
def Splice(expr: Tree, tpt: Tree)(using Context): Splice =
177+
ta.assignType(untpd.Splice(expr, tpt), tpt)
178178

179179
def TypeTree(tp: Type, inferred: Boolean = false)(using Context): TypeTree =
180180
(if inferred then untpd.InferredTypeTree() else untpd.TypeTree()).withType(tp)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
397397
def SeqLiteral(elems: List[Tree], elemtpt: Tree)(implicit src: SourceFile): SeqLiteral = new SeqLiteral(elems, elemtpt)
398398
def JavaSeqLiteral(elems: List[Tree], elemtpt: Tree)(implicit src: SourceFile): JavaSeqLiteral = new JavaSeqLiteral(elems, elemtpt)
399399
def Inlined(call: tpd.Tree, bindings: List[MemberDef], expansion: Tree)(implicit src: SourceFile): Inlined = new Inlined(call, bindings, expansion)
400-
def QuotedExpr(expr: Tree, tpt: Tree)(implicit src: SourceFile): QuotedExpr = new QuotedExpr(expr, tpt)
401-
def SplicedExpr(expr: Tree, tpt: Tree)(implicit src: SourceFile): SplicedExpr = new SplicedExpr(expr, tpt)
400+
def Quote(expr: Tree, tpt: Tree)(implicit src: SourceFile): Quote = new Quote(expr, tpt)
401+
def Splice(expr: Tree, tpt: Tree)(implicit src: SourceFile): Splice = new Splice(expr, tpt)
402402
def TypeTree()(implicit src: SourceFile): TypeTree = new TypeTree()
403403
def InferredTypeTree()(implicit src: SourceFile): TypeTree = new InferredTypeTree()
404404
def SingletonTypeTree(ref: Tree)(implicit src: SourceFile): SingletonTypeTree = new SingletonTypeTree(ref)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,15 +665,15 @@ class TreePickler(pickler: TastyPickler) {
665665
pickleTree(hi)
666666
pickleTree(alias)
667667
}
668-
case QuotedExpr(expr, tpt) =>
668+
case Quote(expr, tpt) =>
669669
pickleTree(
670670
// scala.quoted.runtime.Expr.quoted[<tpt>](<expr>)
671671
ref(defn.QuotedRuntime_exprQuote)
672672
.appliedToTypeTree(tpt)
673673
.appliedTo(expr)
674674
.withSpan(tree.span)
675675
)
676-
case SplicedExpr(expr, tpt) =>
676+
case Splice(expr, tpt) =>
677677
pickleTree(
678678
// scala.quoted.runtime.Expr.splice[<tpt>](<spliced>)
679679
ref(defn.QuotedRuntime_exprSplice)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,16 +1269,16 @@ class TreeUnpickler(reader: TastyReader,
12691269

12701270
def quotedExpr(fn: Tree, args: List[Tree]): Tree =
12711271
val TypeApply(_, targs) = fn: @unchecked
1272-
QuotedExpr(args.head, targs.head)
1272+
Quote(args.head, targs.head)
12731273

12741274
def splicedExpr(fn: Tree, args: List[Tree]): Tree =
12751275
val TypeApply(_, targs) = fn: @unchecked
1276-
SplicedExpr(args.head, targs.head)
1276+
Splice(args.head, targs.head)
12771277

12781278
def nestedSpliceExpr(fn: Tree, args: List[Tree]): Tree =
12791279
fn match
12801280
case Apply(TypeApply(_, targs), _ :: Nil) => // nestedSplice[T](quotes)(expr)
1281-
SplicedExpr(args.head, targs.head)
1281+
Splice(args.head, targs.head)
12821282
case _ => // nestedSplice[T](quotes)
12831283
tpd.Apply(fn, args)
12841284

compiler/src/dotty/tools/dotc/inlines/Inliner.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -825,16 +825,16 @@ class Inliner(val call: tpd.Tree)(using Context):
825825
ctx.compilationUnit.needsStaging = true
826826
tree1
827827

828-
override def typedQuotedExpr(tree: untpd.QuotedExpr, pt: Type)(using Context): Tree =
829-
super.typedQuotedExpr(tree, pt) match
830-
case QuotedExpr(SplicedExpr(inner, _), _) => inner
828+
override def typedQuote(tree: untpd.Quote, pt: Type)(using Context): Tree =
829+
super.typedQuote(tree, pt) match
830+
case Quote(Splice(inner, _), _) => inner
831831
case tree1 =>
832832
ctx.compilationUnit.needsStaging = true
833833
tree1
834834

835-
override def typedSplicedExpr(tree: untpd.SplicedExpr, pt: Type)(using Context): Tree =
836-
super.typedSplicedExpr(tree, pt) match
837-
case tree1 @ SplicedExpr(expr, tpt)
835+
override def typedSplice(tree: untpd.Splice, pt: Type)(using Context): Tree =
836+
super.typedSplice(tree, pt) match
837+
case tree1 @ Splice(expr, tpt)
838838
if StagingLevel.level == 0
839839
&& !hasInliningErrors =>
840840
val expanded = expandMacro(expr, tree1.srcPos)
@@ -1070,15 +1070,15 @@ class Inliner(val call: tpd.Tree)(using Context):
10701070
else tree match {
10711071
case tree: RefTree if tree.isTerm && tree.symbol.isDefinedInCurrentRun && !tree.symbol.isLocal =>
10721072
foldOver(tree.symbol :: syms, tree)
1073-
case QuotedExpr(body, _) =>
1073+
case Quote(body, _) =>
10741074
level += 1
10751075
try apply(syms, body)
10761076
finally level -= 1
10771077
case QuotedTypeOf(body) =>
10781078
level += 1
10791079
try apply(syms, body)
10801080
finally level -= 1
1081-
case SplicedExpr(body, _) =>
1081+
case Splice(body, _) =>
10821082
level -= 1
10831083
try apply(syms, body)
10841084
finally level += 1

compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ object PrepareInlineable {
9191
}
9292

9393
private def stagingContext(tree: Tree)(using Context): Context = tree match
94-
case tree: QuotedExpr => StagingLevel.quoteContext
94+
case tree: Quote => StagingLevel.quoteContext
9595
case tree: Apply if tree.symbol eq defn.QuotedTypeModule_of => StagingLevel.quoteContext
96-
case tree: SplicedExpr => StagingLevel.spliceContext
96+
case tree: Splice => StagingLevel.spliceContext
9797
case _ => ctx
9898
}
9999

@@ -291,7 +291,7 @@ object PrepareInlineable {
291291
if (inlined.is(Macro) && !ctx.isAfterTyper) {
292292

293293
def checkMacro(tree: Tree): Unit = tree match {
294-
case SplicedExpr(code, _) =>
294+
case Splice(code, _) =>
295295
if (code.symbol.flags.is(Inline))
296296
report.error("Macro cannot be implemented with an `inline` method", code.srcPos)
297297
Splicer.checkValidMacroBody(code)

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ object Parsers {
12621262
}
12631263
}
12641264
in.nextToken()
1265-
QuotedExpr(t, EmptyTree)
1265+
Quote(t, EmptyTree)
12661266
}
12671267
else
12681268
if !in.featureEnabled(Feature.symbolLiterals) then
@@ -1764,7 +1764,7 @@ object Parsers {
17641764
syntaxError(em"$msg\n\nHint: $hint", Span(start, in.lastOffset))
17651765
Ident(nme.ERROR.toTypeName)
17661766
else
1767-
SplicedExpr(expr, EmptyTree)
1767+
Splice(expr, EmptyTree)
17681768
}
17691769

17701770
/** SimpleType ::= SimpleLiteral
@@ -2497,7 +2497,7 @@ object Parsers {
24972497
val expr =
24982498
if (in.token == LBRACKET) inBrackets(typ())
24992499
else stagedBlock()
2500-
QuotedExpr(expr, EmptyTree)
2500+
Quote(expr, EmptyTree)
25012501
}
25022502
}
25032503
case NEW =>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,10 +716,10 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
716716
"Thicket {" ~~ toTextGlobal(trees, "\n") ~~ "}"
717717
case MacroTree(call) =>
718718
keywordStr("macro ") ~ toTextGlobal(call)
719-
case QuotedExpr(expr, tpt) =>
719+
case Quote(expr, tpt) =>
720720
val tptText = (keywordStr("[") ~ toTextGlobal(tpt) ~ keywordStr("]")).provided(!tpt.isEmpty && printDebug)
721721
keywordStr("'") ~ tptText ~ keywordStr("{") ~ toTextGlobal(expr) ~ keywordStr("}")
722-
case SplicedExpr(expr, tpt) =>
722+
case Splice(expr, tpt) =>
723723
val tptText = (keywordStr("[") ~ toTextGlobal(tpt) ~ keywordStr("]")).provided(!tpt.isEmpty && printDebug)
724724
keywordStr("$") ~ tptText ~ keywordStr("{") ~ toTextGlobal(expr) ~ keywordStr("}")
725725
case Hole(isTermHole, idx, args, content, tpt) =>

compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ class CrossStageSafety extends TreeMapWithStages {
9797
}
9898

9999
/** Transform quoted trees while maintaining level correctness */
100-
override protected def transformQuotedExpr(body: Tree, quote: QuotedExpr)(using Context): Tree = {
100+
override protected def transformQuote(body: Tree, quote: Quote)(using Context): Tree = {
101101
if (ctx.property(InAnnotation).isDefined)
102102
report.error("Cannot have a quote in an annotation", quote.srcPos)
103103
val transformedBody = transformQuoteBody(body, quote.span)
104104
val stripAnnotsDeep: TypeMap = new TypeMap:
105105
def apply(tp: Type): Type = mapOver(tp.stripAnnots)
106106
val tpt1 = TypeTree(healType(quote.tpt.srcPos)(stripAnnotsDeep(quote.tpt.tpe)))
107-
cpy.QuotedExpr(quote)(transformedBody, tpt1)
107+
cpy.Quote(quote)(transformedBody, tpt1)
108108
}
109109

110110
override protected def transformQuotedType(body: Tree, quote: Apply)(using Context): Tree = {
@@ -142,15 +142,15 @@ class CrossStageSafety extends TreeMapWithStages {
142142
* - If inside inlined code, expand the macro code.
143143
* - If inside of a macro definition, check the validity of the macro.
144144
*/
145-
protected def transformSplice(body: Tree, splice: SplicedExpr)(using Context): Tree = {
145+
protected def transformSplice(body: Tree, splice: Splice)(using Context): Tree = {
146146
val body1 = transform(body)(using spliceContext)
147147
val tpt1 =
148148
if level == 0 then
149149
transform(splice.tpt)
150150
else
151151
val tp = healType(splice.srcPos)(splice.tpe.widenTermRefExpr)
152152
TypeTree(tp).withSpan(splice.tpt.span)
153-
cpy.SplicedExpr(splice)(body1, tpt1)
153+
cpy.Splice(splice)(body1, tpt1)
154154
}
155155

156156
protected def transformSpliceType(body: Tree, splice: Select)(using Context): Tree = {

compiler/src/dotty/tools/dotc/staging/TreeMapWithStages.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
2525
*
2626
* - `quoted.runtime.Expr.quote[T](<body0>)` --> `quoted.runtime.Expr.quote[T](<body>)`
2727
*/
28-
protected def transformQuotedExpr(body: Tree, quote: QuotedExpr)(using Context): Tree =
29-
cpy.QuotedExpr(quote)(body, quote.tpt)
28+
protected def transformQuote(body: Tree, quote: Quote)(using Context): Tree =
29+
cpy.Quote(quote)(body, quote.tpt)
3030

3131
/** Transform the quote `quote` which contains the quoted `body`.
3232
*
@@ -37,7 +37,7 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
3737
cpy.Apply(quote)(cpy.TypeApply(quote.fun)(fun, body :: Nil), quote.args)
3838

3939
/** Transform the expression splice `splice` which contains the spliced `body`. */
40-
protected def transformSplice(body: Tree, splice: SplicedExpr)(using Context): Tree
40+
protected def transformSplice(body: Tree, splice: Splice)(using Context): Tree
4141

4242
/** Transform the type splice `splice` which contains the spliced `body`. */
4343
protected def transformSpliceType(body: Tree, splice: Select)(using Context): Tree
@@ -62,24 +62,24 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
6262
try transformQuotedType(quotedTree, tree)
6363
finally inQuoteOrSplice = old
6464

65-
case tree @ QuotedExpr(quotedTree, _) =>
65+
case tree @ Quote(quotedTree, _) =>
6666
val old = inQuoteOrSplice
6767
inQuoteOrSplice = true
6868
try dropEmptyBlocks(quotedTree) match {
69-
case SplicedExpr(t, _) =>
69+
case Splice(t, _) =>
7070
// Optimization: `'{ $x }` --> `x`
7171
// and adapt the refinement of `Quotes { type reflect: ... } ?=> Expr[T]`
7272
transform(t).asInstance(tree.tpe)
7373
case _ =>
74-
transformQuotedExpr(quotedTree, tree)
74+
transformQuote(quotedTree, tree)
7575
}
7676
finally inQuoteOrSplice = old
7777

78-
case tree @ SplicedExpr(splicedTree, _) =>
78+
case tree @ Splice(splicedTree, _) =>
7979
val old = inQuoteOrSplice
8080
inQuoteOrSplice = true
8181
try dropEmptyBlocks(splicedTree) match {
82-
case QuotedExpr(t, _) =>
82+
case Quote(t, _) =>
8383
// Optimization: `${ 'x }` --> `x`
8484
transform(t)
8585
case _ =>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ class ElimByName extends MiniPhase, InfoTransformer:
160160
}
161161

162162
override def transformOther(tree: Tree)(using Context): Tree = tree match
163-
case tree @ SplicedExpr(spliced, tpt) =>
163+
case tree @ Splice(spliced, tpt) =>
164164
assert(dotty.tools.dotc.inlines.Inlines.inInlineMethod)
165-
cpy.SplicedExpr(tree)(transformAllDeep(spliced), tpt)
165+
cpy.Splice(tree)(transformAllDeep(spliced), tpt)
166166
case tree => tree
167167

168168
object ElimByName:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ class FirstTransform extends MiniPhase with InfoTransformer { thisPhase =>
153153
override def transformOther(tree: Tree)(using Context): Tree = tree match {
154154
case tree: Export => EmptyTree
155155
case tree: NamedArg => transformAllDeep(tree.arg)
156-
case tree @ SplicedExpr(expr, tpt) =>
156+
case tree @ Splice(expr, tpt) =>
157157
assert(dotty.tools.dotc.inlines.Inlines.inInlineMethod)
158-
cpy.SplicedExpr(tree)(transformAllDeep(expr), transformAllDeep(tpt))
158+
cpy.Splice(tree)(transformAllDeep(expr), transformAllDeep(tpt))
159159
case tree => if (tree.isType) toTypeTree(tree) else tree
160160
}
161161

0 commit comments

Comments
 (0)