[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 DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
|
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
|
@Test
|
||||||
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
||||||
public void testPropertyFromAbstractSuperClass() throws Exception {
|
public void testPropertyFromAbstractSuperClass() throws Exception {
|
||||||
|
|||||||
+6
@@ -3859,6 +3859,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
|
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
|
@Test
|
||||||
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
||||||
public void testPropertyFromAbstractSuperClass() throws Exception {
|
public void testPropertyFromAbstractSuperClass() throws Exception {
|
||||||
|
|||||||
+6
@@ -3865,6 +3865,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
|
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
|
@Test
|
||||||
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
||||||
public void testPropertyFromAbstractSuperClass() throws Exception {
|
public void testPropertyFromAbstractSuperClass() throws Exception {
|
||||||
|
|||||||
+1
-1
@@ -443,7 +443,7 @@ private fun createKPropertyType(
|
|||||||
private fun FirVariable.canBeMutableReference(candidate: Candidate): Boolean {
|
private fun FirVariable.canBeMutableReference(candidate: Candidate): Boolean {
|
||||||
if (!isVar) return false
|
if (!isVar) return false
|
||||||
if (this is FirField) return true
|
if (this is FirField) return true
|
||||||
val original = this.unwrapFakeOverrides()
|
val original = this.unwrapFakeOverridesOrDelegated()
|
||||||
return original.source?.kind == KtFakeSourceElementKind.PropertyFromParameter ||
|
return original.source?.kind == KtFakeSourceElementKind.PropertyFromParameter ||
|
||||||
(original.setter is FirMemberDeclaration &&
|
(original.setter is FirMemberDeclaration &&
|
||||||
candidate.callInfo.session.visibilityChecker.isVisible(original.setter!!, candidate))
|
candidate.callInfo.session.visibilityChecker.isVisible(original.setter!!, candidate))
|
||||||
|
|||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
|
||||||
|
import kotlin.reflect.KMutableProperty0
|
||||||
|
import kotlin.reflect.KProperty0
|
||||||
|
|
||||||
|
interface MkMutableSharedSettingsHolder {
|
||||||
|
var cleanTarget: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
data class MakefileSettingsFacade(
|
||||||
|
val projectSettings: MkMutableSharedSettingsHolder
|
||||||
|
): MkMutableSharedSettingsHolder by projectSettings {
|
||||||
|
var cleanTarget2: String? = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T> consume(arg: T) {}
|
||||||
|
|
||||||
|
fun foo(arg: MakefileSettingsFacade) {
|
||||||
|
consume<KProperty0<String?>>(arg::cleanTarget)
|
||||||
|
consume<KMutableProperty0<String?>>(arg::cleanTarget)
|
||||||
|
}
|
||||||
Generated
+6
@@ -3865,6 +3865,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
|
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
|
@Test
|
||||||
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
@TestMetadata("propertyFromAbstractSuperClass.kt")
|
||||||
public void testPropertyFromAbstractSuperClass() throws Exception {
|
public void testPropertyFromAbstractSuperClass() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user