Skip to content

Commit

Permalink
Make RecType.recThis a public val.
Browse files Browse the repository at this point in the history
This is necessary to construct `RecType`s from scratch outside of
tasty-query.

`LambdaType.paramRefs`, which performs a similar role, is already
a public val.
  • Loading branch information
sjrd committed Dec 17, 2022
1 parent 22db0fd commit 3fe96cb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tasty-query/shared/src/main/scala/tastyquery/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1429,15 +1429,8 @@ object Types {
final class RecType private (parentExp: RecType => Type) extends RefinedOrRecType with Binders:
val parent: Type = parentExp(this: @unchecked)

private var myRecThis: RecThis | Null = null

private[tastyquery] final def recThis: RecThis =
val local = myRecThis
if local != null then local
else
val computed = RecThis(this)
myRecThis = computed
computed
/** Reference to this recursive type from within itself. */
val recThis: RecThis = RecThis(this)

def underlying(using Context): Type = parent
end RecType
Expand Down

0 comments on commit 3fe96cb

Please sign in to comment.