[FIR] Store cachedExpandedType in WeakPair instead of usual Pair
WeakPair is a renamed OneElementWeakMap
This commit is contained in:
+2
-1
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.fir.symbols.impl
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||
import org.jetbrains.kotlin.fir.utils.WeakPair
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
@RequiresOptIn
|
||||
@@ -19,7 +20,7 @@ class ConeClassLikeLookupTagImpl(override val classId: ClassId) : ConeClassLikeL
|
||||
}
|
||||
|
||||
@LookupTagInternals
|
||||
var boundSymbol: OneElementWeakMap<FirSession, FirClassLikeSymbol<*>?>? = null
|
||||
var boundSymbol: WeakPair<FirSession, FirClassLikeSymbol<*>?>? = null
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir.symbols.impl
|
||||
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
class OneElementWeakMap<K, V> private constructor(
|
||||
private val keyReference: WeakReference<K>,
|
||||
private val valueReference: WeakReference<V>
|
||||
) {
|
||||
constructor(key: K, value: V) : this(WeakReference(key), WeakReference(value))
|
||||
|
||||
val key: K?
|
||||
get() = keyReference.get()
|
||||
|
||||
val value: V?
|
||||
get() = valueReference.get()
|
||||
}
|
||||
Reference in New Issue
Block a user