Skip to content

Commit 0c6356c

Browse files
committed
Rename SyntheticBounds to WildcardTypeTree
1 parent 1434496 commit 0c6356c

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ trait TypeOrBoundsTreesOpsImpl extends scala.tasty.reflect.TypeOrBoundsTreeOps w
159159
}
160160
}
161161

162-
object SyntheticBounds extends SyntheticBoundsExtractor {
162+
object WildcardTypeTree extends WildcardTypeTreeExtractor {
163163
def unapply(x: TypeOrBoundsTree)(implicit ctx: Context): Boolean = x match {
164164
case x @ Trees.TypeTree() => x.tpe.isInstanceOf[Types.TypeBounds]
165165
case Trees.Ident(nme.WILDCARD) => x.tpe.isInstanceOf[Types.TypeBounds]

library/src/scala/tasty/reflect/Core.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ package scala.tasty.reflect
5252
* | +- Bind
5353
* |
5454
* +- TypeBoundsTree
55-
* +- SyntheticBounds
55+
* +- WildcardTypeTree
5656
*
5757
* +- CaseDef
5858
* +- TypeCaseDef
@@ -311,6 +311,9 @@ trait Core {
311311
/** Type tree representing a type bound written in the source */
312312
type TypeBoundsTree <: TypeOrBoundsTree
313313

314+
/** Type tree representing wildcard type bounds written in the source */
315+
type WildcardType <: TypeOrBoundsTree
316+
314317
/** Type or bounds */
315318
type TypeOrBounds <: AnyRef
316319

library/src/scala/tasty/reflect/Printers.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ trait Printers
190190
this += "TypeTree.Block(" ++= aliases += ", " += tpt += ")"
191191
case TypeBoundsTree(lo, hi) =>
192192
this += "TypeBoundsTree(" += lo += ", " += hi += ")"
193-
case SyntheticBounds() =>
194-
this += s"SyntheticBounds()"
193+
case WildcardTypeTree() =>
194+
this += s"WildcardTypeTree()"
195195
case TypeTree.MatchType(bound, selector, cases) =>
196196
this += "TypeTree.MatchType(" += bound += ", " += selector += ", " ++= cases += ")"
197197
}
@@ -996,7 +996,7 @@ trait Printers
996996
this += arg.name
997997
arg.rhs match {
998998
case IsTypeBoundsTree(rhs) => printBoundsTree(rhs)
999-
case rhs @ SyntheticBounds() =>
999+
case rhs @ WildcardTypeTree() =>
10001000
printTypeOrBound(rhs.tpe)
10011001
case rhs @ TypeTree.TypeLambdaTree(tparams, body) =>
10021002
def printParam(t: TypeOrBoundsTree): Unit = t match {
@@ -1184,7 +1184,7 @@ trait Printers
11841184
printTypeTree(lo)
11851185
this += " <: "
11861186
printTypeTree(hi)
1187-
case tpt @ SyntheticBounds() =>
1187+
case tpt @ WildcardTypeTree() =>
11881188
printTypeOrBound(tpt.tpe)
11891189
case IsTypeTree(tpt) =>
11901190
printTypeTree(tpt)

library/src/scala/tasty/reflect/TreeUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ trait TreeUtils
105105
case TypeTree.MatchType(boundopt, selector, cases) =>
106106
foldTypeCaseDefs(foldTypeTree(boundopt.fold(x)(foldTypeTree(x, _)), selector), cases)
107107
case TypeBoundsTree(lo, hi) => foldTypeTree(foldTypeTree(x, lo), hi)
108-
case SyntheticBounds() => x
108+
case WildcardTypeTree() => x
109109
}
110110

111111
def foldOverCaseDef(x: X, tree: CaseDef)(implicit ctx: Context): X = tree match {

library/src/scala/tasty/reflect/TypeOrBoundsTreeOps.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ trait TypeOrBoundsTreeOps extends Core {
125125
def unapply(typeOrBoundsTree: TypeOrBoundsTree)(implicit ctx: Context): Option[(TypeTree, TypeTree)]
126126
}
127127

128-
/** TypeBoundsTree containing an inferred type bounds */
129-
val SyntheticBounds: SyntheticBoundsExtractor
130-
abstract class SyntheticBoundsExtractor {
131-
/** Matches a TypeBoundsTree containing inferred type bounds */
128+
/** TypeBoundsTree containing wildcard type bounds */
129+
val WildcardTypeTree: WildcardTypeTreeExtractor
130+
abstract class WildcardTypeTreeExtractor {
131+
/** Matches a TypeBoundsTree containing wildcard type bounds */
132132
def unapply(typeOrBoundsTree: TypeOrBoundsTree)(implicit ctx: Context): Boolean
133133
}
134134

0 commit comments

Comments
 (0)