[light classes] KtUltraLightParameterForDescriptor: fix descriptor leak
^KTIJ-21151
This commit is contained in:
+7
-2
@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.psi.KtDeclaration
|
|||||||
import org.jetbrains.kotlin.psi.KtFunction
|
import org.jetbrains.kotlin.psi.KtFunction
|
||||||
import org.jetbrains.kotlin.psi.KtParameter
|
import org.jetbrains.kotlin.psi.KtParameter
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.isPrivate
|
import org.jetbrains.kotlin.psi.psiUtil.isPrivate
|
||||||
|
import org.jetbrains.kotlin.resolve.indexOrMinusOne
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
|
|
||||||
internal class KtUltraLightSuspendContinuationParameter(
|
internal class KtUltraLightSuspendContinuationParameter(
|
||||||
@@ -264,7 +265,7 @@ internal class KtUltraLightReceiverParameter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal class KtUltraLightParameterForDescriptor(
|
internal class KtUltraLightParameterForDescriptor(
|
||||||
private val descriptor: ParameterDescriptor,
|
descriptor: ParameterDescriptor,
|
||||||
support: KtUltraLightSupport,
|
support: KtUltraLightSupport,
|
||||||
method: KtUltraLightMethod
|
method: KtUltraLightMethod
|
||||||
) : KtUltraLightParameter(
|
) : KtUltraLightParameter(
|
||||||
@@ -297,12 +298,16 @@ internal class KtUltraLightParameterForDescriptor(
|
|||||||
computeParameterType(descriptor.type, descriptor.containingDeclaration as? CallableMemberDescriptor)
|
computeParameterType(descriptor.type, descriptor.containingDeclaration as? CallableMemberDescriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val _index: Int by getAndAddLazy {
|
||||||
|
descriptor.indexOrMinusOne()
|
||||||
|
}
|
||||||
|
|
||||||
override fun getType(): PsiType = _parameterType
|
override fun getType(): PsiType = _parameterType
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean = other === this ||
|
override fun equals(other: Any?): Boolean = other === this ||
|
||||||
other is KtUltraLightParameterForDescriptor &&
|
other is KtUltraLightParameterForDescriptor &&
|
||||||
other.name == this.name &&
|
other.name == this.name &&
|
||||||
other.descriptor.type == this.descriptor.type &&
|
other._index == this._index &&
|
||||||
other.method == this.method
|
other.method == this.method
|
||||||
|
|
||||||
override fun hashCode(): Int = name.hashCode()
|
override fun hashCode(): Int = name.hashCode()
|
||||||
|
|||||||
Reference in New Issue
Block a user