Skip to content

Commit 4c055c4

Browse files
Merge pull request #10261 from dotty-staging/rename-reify-quotes
Rename ReifyQuotes to PickleQuotes
2 parents 3ff7f77 + 4e61c32 commit 4c055c4

File tree

17 files changed

+29
-29
lines changed

17 files changed

+29
-29
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Compiler {
5050
/** Phases dealing with TASTY tree pickling and unpickling */
5151
protected def picklerPhases: List[List[Phase]] =
5252
List(new Pickler) :: // Generate TASTY info
53-
List(new ReifyQuotes) :: // Turn quoted trees into explicit run-time data structures
53+
List(new PickleQuotes) :: // Turn quoted trees into explicit run-time data structures
5454
Nil
5555

5656
/** Phases dealing with the transformation from pickled trees to backend trees */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ object Phases {
197197
private var myPostTyperPhase: Phase = _
198198
private var mySbtExtractDependenciesPhase: Phase = _
199199
private var myPicklerPhase: Phase = _
200-
private var myReifyQuotesPhase: Phase = _
200+
private var myPickleQuotesPhase: Phase = _
201201
private var myCollectNullableFieldsPhase: Phase = _
202202
private var myRefChecksPhase: Phase = _
203203
private var myPatmatPhase: Phase = _
@@ -216,7 +216,7 @@ object Phases {
216216
final def postTyperPhase: Phase = myPostTyperPhase
217217
final def sbtExtractDependenciesPhase: Phase = mySbtExtractDependenciesPhase
218218
final def picklerPhase: Phase = myPicklerPhase
219-
final def reifyQuotesPhase: Phase = myReifyQuotesPhase
219+
final def pickleQuotesPhase: Phase = myPickleQuotesPhase
220220
final def collectNullableFieldsPhase: Phase = myCollectNullableFieldsPhase
221221
final def refchecksPhase: Phase = myRefChecksPhase
222222
final def patmatPhase: Phase = myPatmatPhase
@@ -238,7 +238,7 @@ object Phases {
238238
myPostTyperPhase = phaseOfClass(classOf[PostTyper])
239239
mySbtExtractDependenciesPhase = phaseOfClass(classOf[sbt.ExtractDependencies])
240240
myPicklerPhase = phaseOfClass(classOf[Pickler])
241-
myReifyQuotesPhase = phaseOfClass(classOf[ReifyQuotes])
241+
myPickleQuotesPhase = phaseOfClass(classOf[PickleQuotes])
242242
myCollectNullableFieldsPhase = phaseOfClass(classOf[CollectNullableFields])
243243
myRefChecksPhase = phaseOfClass(classOf[RefChecks])
244244
myElimRepeatedPhase = phaseOfClass(classOf[ElimRepeated])
@@ -402,7 +402,7 @@ object Phases {
402402
def postTyperPhase(using Context): Phase = ctx.base.postTyperPhase
403403
def sbtExtractDependenciesPhase(using Context): Phase = ctx.base.sbtExtractDependenciesPhase
404404
def picklerPhase(using Context): Phase = ctx.base.picklerPhase
405-
def reifyQuotesPhase(using Context): Phase = ctx.base.reifyQuotesPhase
405+
def pickleQuotesPhase(using Context): Phase = ctx.base.pickleQuotesPhase
406406
def refchecksPhase(using Context): Phase = ctx.base.refchecksPhase
407407
def elimRepeatedPhase(using Context): Phase = ctx.base.elimRepeatedPhase
408408
def extensionMethodsPhase(using Context): Phase = ctx.base.extensionMethodsPhase

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ object PickledQuotes {
8787
if filled.source == ctx.source then filled
8888
else filled.cloneIn(ctx.source).withSpan(tree.span)
8989
else
90-
// Replaces type holes generated by ReifyQuotes (non-spliced types).
90+
// Replaces type holes generated by PickleQuotes (non-spliced types).
9191
// These are types defined in a quote and used at the same level in a nested quote.
9292
val quotedType = pickledQuote.typeSplice(idx)(reifiedArgs)
9393
PickledQuotes.quotedTypeToTree(quotedType)

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala renamed to compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ import scala.annotation.constructorOnly
6464
* and then performs the same transformation on `'{ ... ${x1$1} ... ${x2$1} ...}`.
6565
*
6666
*/
67-
class ReifyQuotes extends MacroTransform {
68-
import ReifyQuotes._
67+
class PickleQuotes extends MacroTransform {
68+
import PickleQuotes._
6969
import tpd._
7070

71-
override def phaseName: String = ReifyQuotes.name
71+
override def phaseName: String = PickleQuotes.name
7272

7373
override def allowsImplicitSearch: Boolean = true
7474

@@ -463,10 +463,10 @@ class ReifyQuotes extends MacroTransform {
463463
}
464464

465465

466-
object ReifyQuotes {
466+
object PickleQuotes {
467467
import tpd._
468468

469-
val name: String = "reifyQuotes"
469+
val name: String = "pickleQuotes"
470470

471471
def getLiteral(tree: tpd.Tree): Option[Literal] = tree match {
472472
case tree: Literal => Some(tree)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Staging extends MacroTransform {
3838
override def allowsImplicitSearch: Boolean = true
3939

4040
override def checkPostCondition(tree: Tree)(using Context): Unit =
41-
if (ctx.phase <= reifyQuotesPhase) {
41+
if (ctx.phase <= pickleQuotesPhase) {
4242
// Recheck that PCP holds but do not heal any inconsistent types as they should already have been heald
4343
tree match {
4444
case PackageDef(pid, _) if tree.symbol.owner == defn.RootClass =>

docs/docs/internals/overall-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ phases. The current list of phases is specified in class [Compiler] as follows:
110110
/** Phases dealing with TASTY tree pickling and unpickling */
111111
protected def picklerPhases: List[List[Phase]] =
112112
List(new Pickler) :: // Generate TASTY info
113-
List(new ReifyQuotes) :: // Turn quoted trees into explicit run-time data structures
113+
List(new PickleQuotes) :: // Turn quoted trees into explicit run-time data structures
114114
Nil
115115

116116
/** Phases dealing with the transformation from pickled trees to backend trees */

docs/docs/reference/metaprogramming/macros-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ a quoted expression or type is treated as a splice `${x}` and a quoted identifie
2525

2626
Quotes and splices are primitive forms in the generated abstract syntax trees.
2727
Top-level splices are eliminated during macro expansion while typing. On the
28-
other hand, top-level quotes are eliminated in an expansion phase `ReifyQuotes`
28+
other hand, top-level quotes are eliminated in an expansion phase `PickleQuotes`
2929
phase (after typing and pickling). PCP checking occurs while preparing the RHS
3030
of an inline method for top-level splices and in the `Staging` phase (after
3131
typing and before pickling).

library/src-bootstrapped/scala/internal/quoted/CompileTime.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object CompileTime {
2626
* `'{ @quoteTypeTag type T$1 = $t ... F[T$1] ... }` to have a tree for `$t`.
2727
* This artifact is removed during quote unpickling.
2828
*
29-
* See ReifyQuotes.scala and PickledQuotes.scala
29+
* See PickleQuotes.scala and PickledQuotes.scala
3030
*/
3131
@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.quoteTypeTag`")
3232
class quoteTypeTag extends Annotation

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object Type:
2020
qctx.reflect.TypeTree.of[T].showAnsiColored
2121

2222
/** Return a quoted.Type with the given type */
23-
@compileTimeOnly("Reference to `scala.quoted.Type.apply` was not handled by ReifyQuotes")
23+
@compileTimeOnly("Reference to `scala.quoted.Type.apply` was not handled by PickleQuotes")
2424
given apply[T <: AnyKind] as (QuoteContext ?=> Type[T]) = ???
2525

2626
end Type

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ abstract class Type[T <: AnyKind] private[scala]:
66
type Underlying = T
77

88
object Type:
9-
@compileTimeOnly("Reference to `scala.quoted.Type.apply` was not handled by ReifyQuotes")
9+
@compileTimeOnly("Reference to `scala.quoted.Type.apply` was not handled by PickleQuotes")
1010
given apply[T <: AnyKind] as (QuoteContext ?=> Type[T]) = ???

sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/plugin/SetDefTree.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package analyzer
33
import dotty.tools.dotc.ast.tpd
44
import dotty.tools.dotc.core.Contexts.Context
55
import dotty.tools.dotc.transform.MegaPhase._
6-
import dotty.tools.dotc.transform.{ReifyQuotes, FirstTransform}
6+
import dotty.tools.dotc.transform.{PickleQuotes, FirstTransform}
77
import dotty.tools.dotc.plugins._
88

99
/** Set the `defTree` property of symbols for compile plugins
@@ -16,7 +16,7 @@ class SetDefTree extends PluginPhase {
1616
import tpd._
1717

1818
override val phaseName: String = SetDefTree.name
19-
override def runsAfter: Set[String] = Set(ReifyQuotes.name)
19+
override def runsAfter: Set[String] = Set(PickleQuotes.name)
2020
override def runsBefore: Set[String] = Set(FirstTransform.name)
2121
// don't allow plugins to change tasty
2222
// research plugins can still change the phase plan at will

sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/plugin/SetDefTreeOff.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package analyzer
33
import dotty.tools.dotc.ast.tpd
44
import dotty.tools.dotc.core.Contexts.Context
55
import dotty.tools.dotc.transform.MegaPhase._
6-
import dotty.tools.dotc.transform.{ReifyQuotes, FirstTransform}
6+
import dotty.tools.dotc.transform.{PickleQuotes, FirstTransform}
77
import dotty.tools.dotc.plugins._
88

99
/** Unset the `defTree` property of symbols. See the doc for `SetDefTree` */

staging/src/scala/quoted/staging/QuoteCompiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import dotty.tools.dotc.core.Symbols._
1616
import dotty.tools.dotc.core.Types.ExprType
1717
import dotty.tools.dotc.quoted.PickledQuotes
1818
import dotty.tools.dotc.transform.Splicer.checkEscapedVariables
19-
import dotty.tools.dotc.transform.ReifyQuotes
19+
import dotty.tools.dotc.transform.PickleQuotes
2020
import dotty.tools.dotc.util.Spans.Span
2121
import dotty.tools.dotc.util.SourceFile
2222
import dotty.tools.io.{Path, VirtualFile}
@@ -37,7 +37,7 @@ private class QuoteCompiler extends Compiler:
3737
List(List(new QuotedFrontend))
3838

3939
override protected def picklerPhases: List[List[Phase]] =
40-
List(List(new ReifyQuotes))
40+
List(List(new PickleQuotes))
4141

4242
override def newRun(implicit ctx: Context): ExprRun =
4343
reset()

tests/plugins/custom/analyzer/Analyzer_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import Decorators._
1919
import Symbols.{Symbol, requiredPackage}
2020
import Constants.Constant
2121
import Types._
22-
import transform.{ReifyQuotes, FirstTransform}
22+
import transform.{PickleQuotes, FirstTransform}
2323

2424
class SetDefTree extends PluginPhase {
2525
import tpd._
2626

2727
override val phaseName: String = SetDefTree.name
28-
override def runsAfter: Set[String] = Set(ReifyQuotes.name)
28+
override def runsAfter: Set[String] = Set(PickleQuotes.name)
2929
override def runsBefore: Set[String] = Set(FirstTransform.name)
3030
// don't allow plugins to change tasty
3131
// research plugins can still change the phase plan at will

tests/plugins/neg/divideZero/plugin_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import transform.MegaPhase.MiniPhase
88
import Decorators._
99
import Symbols.{Symbol, requiredClass}
1010
import Constants.Constant
11-
import transform.{Pickler, ReifyQuotes}
11+
import transform.{Pickler, PickleQuotes}
1212
import StdNames._
1313

1414
class DivideZero extends PluginPhase with StandardPlugin {
@@ -18,7 +18,7 @@ class DivideZero extends PluginPhase with StandardPlugin {
1818
val phaseName = name
1919

2020
override val runsAfter = Set(Pickler.name)
21-
override val runsBefore = Set(ReifyQuotes.name)
21+
override val runsBefore = Set(PickleQuotes.name)
2222

2323
override def init(options: List[String]): List[PluginPhase] = this :: Nil
2424

tests/pos-macros/i8100.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def f[T: Type](using QuoteContext) =
1414
${ g[m.E](using Type[ME]) }
1515
${ g[ME](using Type[m.E]) }
1616
${ g[m.E](using Type[m.E]) }
17-
// ${ g[ME] } // FIXME: issue seems to be in ReifyQuotes
18-
// ${ g[m.E] } // FIXME: issue seems to be in ReifyQuotes
17+
// ${ g[ME] } // FIXME: issue seems to be in PickleQuotes
18+
// ${ g[m.E] } // FIXME: issue seems to be in PickleQuotes
1919
}
2020

2121
def g[T](using Type[T]) = ???

tests/run/opaque-immutable-array-xm.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Test extends App {
1010
def apply[A: ClassTag](xs: A*): IArray[A] = initialize(Array(xs: _*))
1111

1212
// These should be inline but that does not work currently. Try again
13-
// once inliner is moved to ReifyQuotes
13+
// once inliner is moved to PickleQuotes
1414
extension [A](ia: IArray[A]) def length: Int = (ia: Array[A]).length
1515
extension [A](ia: IArray[A]) def apply (i: Int): A = (ia: Array[A])(i)
1616

0 commit comments

Comments
 (0)