Skip to content

Commit 5163b70

Browse files
Merge pull request #6193 from dotty-staging/flatten-term-type-tree-modules
Flatten term type tree modules
2 parents c059b64 + d4d3e68 commit 5163b70

File tree

49 files changed

+1105
-1131
lines changed

Some content is hidden

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

49 files changed

+1105
-1131
lines changed

docs/docs/reference/other-new-features/tasty-reflect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ TASTy Reflect provides the following types:
119119
+- TypeTree ----+- Inferred
120120
| +- TypeIdent
121121
| +- TypeSelect
122-
| +- Project
122+
| +- Projection
123123
| +- Singleton
124124
| +- Refined
125125
| +- Applied

library/src-bootstrapped/scala/tasty/reflect/utils/TreeUtils.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ trait TreeUtils {
99
import reflect._
1010

1111
/** Bind the `rhs` to a `val` and use it in `body` */
12-
def let(rhs: Term)(body: Term.Ident => Term): Term = {
12+
def let(rhs: Term)(body: Ident => Term): Term = {
1313
type T // TODO probably it is better to use the Sealed contruct rather than let the user create their own existential type
1414
implicit val rhsTpe: quoted.Type[T] = rhs.tpe.seal.asInstanceOf[quoted.Type[T]]
1515
val rhsExpr = rhs.seal[T]
1616
val expr = '{
1717
val x = $rhsExpr
1818
${
19-
val id = ('x).unseal.asInstanceOf[Term.Ident]
19+
val id = ('x).unseal.asInstanceOf[Ident]
2020
body(id).seal[Any]
2121
}
2222
}

library/src-non-bootstrapped/scala/tasty/reflect/utils/TreeUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait TreeUtils {
77
import reflect._
88

99
/** Bind the `rhs` to a `val` and use it in `body` */
10-
def let(rhs: Term)(bodyType: Type)(body: Term.Ident => Term): Term =
10+
def let(rhs: Term)(bodyType: Type)(body: Ident => Term): Term =
1111
throw new Exception("non bootstrpped lib")
1212

1313
}

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

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ package scala.tasty.reflect
4141
* +- TypeTree ----+- Inferred
4242
* | +- TypeIdent
4343
* | +- TypeSelect
44-
* | +- Project
44+
* | +- Projection
4545
* | +- Singleton
4646
* | +- Refined
4747
* | +- Applied
@@ -160,12 +160,6 @@ trait Core {
160160
/** Tree representing an expression in the source code */
161161
type Term = kernel.Term
162162

163-
/** Trees representing an expression in the source code */
164-
val Term: TermCoreModule
165-
166-
/** Trees representing an expression in the source code */
167-
trait TermCoreModule {
168-
169163
/** Tree representing a reference to definition */
170164
type Ref = kernel.Ref
171165

@@ -235,17 +229,9 @@ trait Core {
235229
/** Tree representing a while loop */
236230
type While = kernel.While
237231

238-
}
239-
240232
/** Type tree representing a type written in the source */
241233
type TypeTree = kernel.TypeTree
242234

243-
/** Type trees representing a type written in the source */
244-
val TypeTree: TypeTreeCoreModule
245-
246-
/** Type trees representing a type written in the source */
247-
trait TypeTreeCoreModule {
248-
249235
/** Type tree representing an inferred type */
250236
type Inferred = kernel.Inferred
251237

@@ -285,8 +271,6 @@ trait Core {
285271
/** Type tree within a block with aliases `{ type U1 = ... ; T[U1, U2] }` */
286272
type TypeBlock = kernel.TypeBlock
287273

288-
}
289-
290274
/** Type tree representing a type bound written in the source */
291275
type TypeBoundsTree = kernel.TypeBoundsTree
292276

library/src/scala/tasty/reflect/Kernel.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ package scala.tasty.reflect
4040
* +- TypeTree ----+- Inferred
4141
* | +- TypeIdent
4242
* | +- TypeSelect
43-
* | +- Project
43+
* | +- Projection
4444
* | +- Singleton
4545
* | +- Refined
4646
* | +- Applied

0 commit comments

Comments
 (0)