[SLC] SymbolLightParameterCommon: drop redundant parameterDeclaration
Now we can replace it with kotlinOrigin ^KT-64772
This commit is contained in:
committed by
Space Team
parent
255a2d27f7
commit
b1b33475fa
+5
-7
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.psi.KtParameter
|
|||||||
|
|
||||||
internal abstract class SymbolLightParameterCommon(
|
internal abstract class SymbolLightParameterCommon(
|
||||||
protected val parameterSymbolPointer: KtSymbolPointer<KtValueParameterSymbol>,
|
protected val parameterSymbolPointer: KtSymbolPointer<KtValueParameterSymbol>,
|
||||||
protected val parameterDeclaration: KtParameter?,
|
|
||||||
private val containingMethod: SymbolLightMethodBase,
|
private val containingMethod: SymbolLightMethodBase,
|
||||||
override val kotlinOrigin: KtParameter?,
|
override val kotlinOrigin: KtParameter?,
|
||||||
) : SymbolLightParameterBase(containingMethod) {
|
) : SymbolLightParameterBase(containingMethod) {
|
||||||
@@ -30,7 +29,6 @@ internal abstract class SymbolLightParameterCommon(
|
|||||||
containingMethod: SymbolLightMethodBase,
|
containingMethod: SymbolLightMethodBase,
|
||||||
) : this(
|
) : this(
|
||||||
parameterSymbolPointer = with(ktAnalysisSession) { parameterSymbol.createPointer() },
|
parameterSymbolPointer = with(ktAnalysisSession) { parameterSymbol.createPointer() },
|
||||||
parameterDeclaration = parameterSymbol.sourcePsiSafe(),
|
|
||||||
containingMethod = containingMethod,
|
containingMethod = containingMethod,
|
||||||
kotlinOrigin = parameterSymbol.sourcePsiSafe(),
|
kotlinOrigin = parameterSymbol.sourcePsiSafe(),
|
||||||
)
|
)
|
||||||
@@ -72,7 +70,7 @@ internal abstract class SymbolLightParameterCommon(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getNameIdentifier(): PsiIdentifier = KtLightIdentifier(this, parameterDeclaration)
|
override fun getNameIdentifier(): PsiIdentifier = KtLightIdentifier(this, kotlinOrigin)
|
||||||
|
|
||||||
private val _type by lazyPub {
|
private val _type by lazyPub {
|
||||||
parameterSymbolPointer.withSymbol(ktModule) { parameterSymbol ->
|
parameterSymbolPointer.withSymbol(ktModule) { parameterSymbol ->
|
||||||
@@ -108,13 +106,13 @@ internal abstract class SymbolLightParameterCommon(
|
|||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other !is SymbolLightParameterCommon || other.ktModule != ktModule) return false
|
if (other !is SymbolLightParameterCommon || other.ktModule != ktModule) return false
|
||||||
|
|
||||||
if (parameterDeclaration != null || other.parameterDeclaration != null) {
|
if (kotlinOrigin != null || other.kotlinOrigin != null) {
|
||||||
return parameterDeclaration == other.parameterDeclaration
|
return kotlinOrigin == other.kotlinOrigin
|
||||||
}
|
}
|
||||||
|
|
||||||
return compareSymbolPointers(parameterSymbolPointer, other.parameterSymbolPointer)
|
return compareSymbolPointers(parameterSymbolPointer, other.parameterSymbolPointer)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int = parameterDeclaration?.hashCode() ?: _name.hashCode()
|
override fun hashCode(): Int = kotlinOrigin?.hashCode() ?: _name.hashCode()
|
||||||
override fun isValid(): Boolean = super.isValid() && parameterDeclaration?.isValid ?: parameterSymbolPointer.isValid(ktModule)
|
override fun isValid(): Boolean = super.isValid() && kotlinOrigin?.isValid ?: parameterSymbolPointer.isValid(ktModule)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user