FIR: Minor. Clarify naming for unwrapping overrides
This commit is contained in:
@@ -85,7 +85,7 @@ class FirSyntheticPropertiesScope(
|
|||||||
private fun FirFunctionSymbol<*>.hasJavaOverridden(): Boolean {
|
private fun FirFunctionSymbol<*>.hasJavaOverridden(): Boolean {
|
||||||
var result = false
|
var result = false
|
||||||
baseScope.processOverriddenFunctionsAndSelf(this) {
|
baseScope.processOverriddenFunctionsAndSelf(this) {
|
||||||
if (it.unwrapOverridden().fir.origin == FirDeclarationOrigin.Enhancement) {
|
if (it.unwrapSubstitutionOverrides().fir.origin == FirDeclarationOrigin.Enhancement) {
|
||||||
result = true
|
result = true
|
||||||
ProcessorAction.STOP
|
ProcessorAction.STOP
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ class FirClassSubstitutionScope(
|
|||||||
functionSymbol: FirFunctionSymbol<*>,
|
functionSymbol: FirFunctionSymbol<*>,
|
||||||
processor: (FirFunctionSymbol<*>) -> ProcessorAction
|
processor: (FirFunctionSymbol<*>) -> ProcessorAction
|
||||||
): ProcessorAction {
|
): ProcessorAction {
|
||||||
val unwrapped = functionSymbol.unwrapOverriddenOnce()
|
val unwrapped = functionSymbol.overriddenSymbol as FirFunctionSymbol<*>? ?: functionSymbol
|
||||||
return useSiteMemberScope.processOverriddenFunctions(unwrapped, processor)
|
return useSiteMemberScope.processOverriddenFunctions(unwrapped, processor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,7 @@ abstract class FirCallableSymbol<D : FirCallableDeclaration<D>> : AbstractFirBas
|
|||||||
get() = null
|
get() = null
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun <reified E : FirCallableSymbol<*>> E.unwrapOverriddenOnce(): E {
|
inline fun <reified E : FirCallableSymbol<*>> E.unwrapSubstitutionOverrides(): E {
|
||||||
overriddenSymbol?.let { return it as E }
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fun <reified E : FirCallableSymbol<*>> E.unwrapOverridden(): E {
|
|
||||||
var current = this
|
var current = this
|
||||||
while (current.overriddenSymbol != null) {
|
while (current.overriddenSymbol != null) {
|
||||||
current = current.overriddenSymbol as E
|
current = current.overriddenSymbol as E
|
||||||
|
|||||||
Reference in New Issue
Block a user