[FIR] Fix UNRESOLVED_REFERENCE in callable reference to delegated var
#KT-57204 Fixed
This commit is contained in:
committed by
Space Team
parent
d20ad67aa9
commit
471ecf62c8
+6
@@ -3859,6 +3859,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mutablePropertyViaDelegation.kt")
|
||||
public void testMutablePropertyViaDelegation() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/mutablePropertyViaDelegation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
||||
public void testPropertyFromAbstractSuperClass() throws Exception {
|
||||
|
||||
+6
@@ -3865,6 +3865,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mutablePropertyViaDelegation.kt")
|
||||
public void testMutablePropertyViaDelegation() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/mutablePropertyViaDelegation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
||||
public void testPropertyFromAbstractSuperClass() throws Exception {
|
||||
|
||||
+1
-1
@@ -443,7 +443,7 @@ private fun createKPropertyType(
|
||||
private fun FirVariable.canBeMutableReference(candidate: Candidate): Boolean {
|
||||
if (!isVar) return false
|
||||
if (this is FirField) return true
|
||||
val original = this.unwrapFakeOverrides()
|
||||
val original = this.unwrapFakeOverridesOrDelegated()
|
||||
return original.source?.kind == KtFakeSourceElementKind.PropertyFromParameter ||
|
||||
(original.setter is FirMemberDeclaration &&
|
||||
candidate.callInfo.session.visibilityChecker.isVisible(original.setter!!, candidate))
|
||||
|
||||
Reference in New Issue
Block a user