Skip to content

Commit 0bda01a

Browse files
committed
Rename reflection Projection to TypeProjection
1 parent 2ea33a4 commit 0bda01a

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

compiler/src/scala/quoted/internal/impl/QuoteContextImpl.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,27 +1056,27 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, QuoteUnpickl
10561056
end extension
10571057
end TypeSelectMethodsImpl
10581058

1059-
type Projection = tpd.Select
1059+
type TypeProjection = tpd.Select
10601060

1061-
object ProjectionTypeTest extends TypeTest[Tree, Projection]:
1062-
def unapply(x: Tree): Option[Projection & x.type] = x match
1061+
object TypeProjectionTypeTest extends TypeTest[Tree, TypeProjection]:
1062+
def unapply(x: Tree): Option[TypeProjection & x.type] = x match
10631063
case tpt: (tpd.Select & x.type) if tpt.isType && tpt.qualifier.isType => Some(tpt)
10641064
case _ => None
1065-
end ProjectionTypeTest
1065+
end TypeProjectionTypeTest
10661066

1067-
object Projection extends ProjectionModule:
1068-
def copy(original: Tree)(qualifier: TypeTree, name: String): Projection =
1067+
object TypeProjection extends TypeProjectionModule:
1068+
def copy(original: Tree)(qualifier: TypeTree, name: String): TypeProjection =
10691069
tpd.cpy.Select(original)(qualifier, name.toTypeName)
1070-
def unapply(x: Projection): Option[(TypeTree, String)] =
1070+
def unapply(x: TypeProjection): Option[(TypeTree, String)] =
10711071
Some((x.qualifier, x.name.toString))
1072-
end Projection
1072+
end TypeProjection
10731073

1074-
object ProjectionMethodsImpl extends ProjectionMethods:
1075-
extension (self: Projection):
1074+
object TypeProjectionMethodsImpl extends TypeProjectionMethods:
1075+
extension (self: TypeProjection):
10761076
def qualifier: TypeTree = self.qualifier
10771077
def name: String = self.name.toString
10781078
end extension
1079-
end ProjectionMethodsImpl
1079+
end TypeProjectionMethodsImpl
10801080

10811081
type Singleton = tpd.SingletonTypeTree
10821082

library/src/scala/quoted/QuoteContext.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ trait QuoteContext { self: internal.QuoteUnpickler & internal.QuoteMatching =>
107107
* +- TypeTree ----+- Inferred
108108
* | +- TypeIdent
109109
* | +- TypeSelect
110-
* | +- Projection
110+
* | +- TypeProjection
111111
* | +- Singleton
112112
* | +- Refined
113113
* | +- Applied
@@ -1323,28 +1323,28 @@ trait QuoteContext { self: internal.QuoteUnpickler & internal.QuoteMatching =>
13231323
end TypeSelectMethods
13241324

13251325
/** Type tree representing a selection of definition with a given name on a given type prefix */
1326-
type Projection <: TypeTree
1326+
type TypeProjection <: TypeTree
13271327

1328-
given TypeTest[Tree, Projection] = ProjectionTypeTest
1329-
protected val ProjectionTypeTest: TypeTest[Tree, Projection]
1328+
given TypeTest[Tree, TypeProjection] = TypeProjectionTypeTest
1329+
protected val TypeProjectionTypeTest: TypeTest[Tree, TypeProjection]
13301330

1331-
val Projection: ProjectionModule
1331+
val TypeProjection: TypeProjectionModule
13321332

1333-
trait ProjectionModule { this: Projection.type =>
1333+
trait TypeProjectionModule { this: TypeProjection.type =>
13341334
// TODO def apply(qualifier: TypeTree, name: String): Project
1335-
def copy(original: Tree)(qualifier: TypeTree, name: String): Projection
1336-
def unapply(x: Projection): Option[(TypeTree, String)]
1335+
def copy(original: Tree)(qualifier: TypeTree, name: String): TypeProjection
1336+
def unapply(x: TypeProjection): Option[(TypeTree, String)]
13371337
}
13381338

1339-
given ProjectionMethods as ProjectionMethods = ProjectionMethodsImpl
1340-
protected val ProjectionMethodsImpl: ProjectionMethods
1339+
given TypeProjectionMethods as TypeProjectionMethods = TypeProjectionMethodsImpl
1340+
protected val TypeProjectionMethodsImpl: TypeProjectionMethods
13411341

1342-
trait ProjectionMethods:
1343-
extension (self: Projection):
1342+
trait TypeProjectionMethods:
1343+
extension (self: TypeProjection):
13441344
def qualifier: TypeTree
13451345
def name: String
13461346
end extension
1347-
end ProjectionMethods
1347+
end TypeProjectionMethods
13481348

13491349
/** Type tree representing a singleton type */
13501350
type Singleton <: TypeTree
@@ -3504,7 +3504,7 @@ trait QuoteContext { self: internal.QuoteUnpickler & internal.QuoteMatching =>
35043504
case Inferred() => x
35053505
case TypeIdent(_) => x
35063506
case TypeSelect(qualifier, _) => foldTree(x, qualifier)
3507-
case Projection(qualifier, _) => foldTree(x, qualifier)
3507+
case TypeProjection(qualifier, _) => foldTree(x, qualifier)
35083508
case Singleton(ref) => foldTree(x, ref)
35093509
case Refined(tpt, refinements) => foldTrees(foldTree(x, tpt), refinements)
35103510
case Applied(tpt, args) => foldTrees(foldTree(x, tpt), args)
@@ -3660,8 +3660,8 @@ trait QuoteContext { self: internal.QuoteUnpickler & internal.QuoteMatching =>
36603660
case tree: TypeIdent => tree
36613661
case tree: TypeSelect =>
36623662
TypeSelect.copy(tree)(tree.qualifier, tree.name)
3663-
case tree: Projection =>
3664-
Projection.copy(tree)(tree.qualifier, tree.name)
3663+
case tree: TypeProjection =>
3664+
TypeProjection.copy(tree)(tree.qualifier, tree.name)
36653665
case tree: Annotated =>
36663666
Annotated.copy(tree)(tree.arg, tree.annotation)
36673667
case tree: Singleton =>

0 commit comments

Comments
 (0)