Skip to content

Commit

Permalink
Merge pull request #228 from sjrd/public-rectype-recthis
Browse files Browse the repository at this point in the history
Make `RecType.recThis` a public val.
  • Loading branch information
bishabosha authored Dec 17, 2022
2 parents 22db0fd + 3fe96cb commit a4404b1
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 a4404b1

Please sign in to comment.