From 3fe96cb9d7fa1ed0594e5df9e2c8de2a3c47c03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Sat, 17 Dec 2022 10:38:30 +0100 Subject: [PATCH] Make `RecType.recThis` a public val. 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. --- .../shared/src/main/scala/tastyquery/Types.scala | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tasty-query/shared/src/main/scala/tastyquery/Types.scala b/tasty-query/shared/src/main/scala/tastyquery/Types.scala index 8b465517..a9685a45 100644 --- a/tasty-query/shared/src/main/scala/tastyquery/Types.scala +++ b/tasty-query/shared/src/main/scala/tastyquery/Types.scala @@ -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