diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/KotlinTypeRefinerImpl.kt b/core/descriptors/src/org/jetbrains/kotlin/types/KotlinTypeRefinerImpl.kt index 649c9234cee..e50741114ad 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/KotlinTypeRefinerImpl.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/KotlinTypeRefinerImpl.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.resolve.descriptorUtil.classId import org.jetbrains.kotlin.resolve.descriptorUtil.module import org.jetbrains.kotlin.resolve.scopes.MemberScope +import org.jetbrains.kotlin.storage.CacheWithNotNullValues import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner @@ -25,6 +26,12 @@ class KotlinTypeRefinerImpl( private val moduleDescriptor: ModuleDescriptor, storageManager: StorageManager ) : KotlinTypeRefiner() { + private val refinedTypeCache: CacheWithNotNullValues = + storageManager.createCacheWithNotNullValues() + private val isRefinementNeededForTypeConstructorCache: CacheWithNotNullValues = + storageManager.createCacheWithNotNullValues() + private val scopes: CacheWithNotNullValues = + storageManager.createCacheWithNotNullValues() private var isStandalone: Boolean = false private constructor( @@ -41,10 +48,6 @@ class KotlinTypeRefinerImpl( } } - private val refinedTypeCache = storageManager.createCacheWithNotNullValues() - private val isRefinementNeededForTypeConstructorCache = storageManager.createCacheWithNotNullValues() - private val scopes = storageManager.createCacheWithNotNullValues() - /** * IMPORTANT: that function has not obvious contract: it refines only supertypes, * and don't refines type arguments, so return type is "partly refined".