Skip to content

Commit 2825345

Browse files
committed
Flatten Term and TypeTree modules
1 parent dc7c97f commit 2825345

File tree

47 files changed

+1049
-1075
lines changed

Some content is hidden

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

47 files changed

+1049
-1075
lines changed

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: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)