[FIR] FirDelegatedMemberScope: add missing resolve
^KT-56543
This commit is contained in:
committed by
Space Team
parent
26f8147a8c
commit
7c8f7bdbfb
+17
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
* Copyright 2010-2023 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.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -50,10 +50,12 @@ class FirDelegatedMemberScope(
|
|||||||
result.forEach(processor)
|
result.forEach(processor)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buildScope(delegateField: FirField): FirTypeScope? {
|
private fun buildScope(delegateField: FirField): FirTypeScope? = delegateField.symbol.resolvedReturnType.scope(
|
||||||
return delegateField.returnTypeRef.coneType
|
session,
|
||||||
.scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null)
|
scopeSession,
|
||||||
}
|
FakeOverrideTypeCalculator.DoNothing,
|
||||||
|
requiredPhase = null,
|
||||||
|
)
|
||||||
|
|
||||||
private fun collectFunctionsFromSpecificField(
|
private fun collectFunctionsFromSpecificField(
|
||||||
delegateField: FirField,
|
delegateField: FirField,
|
||||||
@@ -136,19 +138,22 @@ class FirDelegatedMemberScope(
|
|||||||
return@processor
|
return@processor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (propertySymbol.modality == Modality.FINAL || propertySymbol.visibility == Visibilities.Private) {
|
||||||
|
return@processor
|
||||||
|
}
|
||||||
|
|
||||||
val original = propertySymbol.fir
|
val original = propertySymbol.fir
|
||||||
|
var isOverriddenProperty = false
|
||||||
if (original.modality == Modality.FINAL || original.visibility == Visibilities.Private) {
|
declaredMemberScope.processPropertiesByName(name) {
|
||||||
return@processor
|
if (it is FirPropertySymbol && overrideChecker.isOverriddenProperty(it.fir, original)) {
|
||||||
|
isOverriddenProperty = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (declaredMemberScope.getProperties(name)
|
if (isOverriddenProperty) {
|
||||||
.any { it is FirPropertySymbol && overrideChecker.isOverriddenProperty(it.fir, original) }
|
|
||||||
) {
|
|
||||||
return@processor
|
return@processor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
result.firstOrNull {
|
result.firstOrNull {
|
||||||
overrideChecker.isOverriddenProperty(it.fir, original)
|
overrideChecker.isOverriddenProperty(it.fir, original)
|
||||||
}?.let {
|
}?.let {
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_REVERSED_RESOLVE
|
|
||||||
// See KT-15566
|
// See KT-15566
|
||||||
// NI_EXPECTED_FILE
|
// NI_EXPECTED_FILE
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_REVERSED_RESOLVE
|
|
||||||
// See KT-15566
|
// See KT-15566
|
||||||
// NI_EXPECTED_FILE
|
// NI_EXPECTED_FILE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user