diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSFunctionDeclarationImpl.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSFunctionDeclarationImpl.kt index 2079cfe6eb..b64c299f6b 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSFunctionDeclarationImpl.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSFunctionDeclarationImpl.kt @@ -107,7 +107,11 @@ class KSFunctionDeclarationImpl private constructor(internal val ktFunctionSymbo } recordLookupForPropertyOrMethod(this) return analyze { - ktFunctionSymbol.getDirectlyOverriddenSymbols().firstOrNull()?.unwrapFakeOverrides?.toKSDeclaration() + if (ktFunctionSymbol is KtPropertyAccessorSymbol) { + (parentDeclaration as? KSPropertyDeclarationImpl)?.ktPropertySymbol + } else { + ktFunctionSymbol + }?.getDirectlyOverriddenSymbols()?.firstOrNull()?.unwrapFakeOverrides?.toKSDeclaration() }?.also { recordLookupForPropertyOrMethod(it) } } diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSPropertyDeclarationJavaImpl.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSPropertyDeclarationJavaImpl.kt index d93f16b7db..6e9e77b5d0 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSPropertyDeclarationJavaImpl.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSPropertyDeclarationJavaImpl.kt @@ -1,11 +1,8 @@ package com.google.devtools.ksp.impl.symbol.kotlin -import com.google.devtools.ksp.closestClassDeclaration import com.google.devtools.ksp.common.KSObjectCache import com.google.devtools.ksp.common.impl.KSNameImpl import com.google.devtools.ksp.impl.ResolverAAImpl -import com.google.devtools.ksp.impl.recordLookupForPropertyOrMethod -import com.google.devtools.ksp.impl.recordLookupWithSupertypes import com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSTypeReferenceResolvedImpl import com.google.devtools.ksp.symbol.* import org.jetbrains.kotlin.analysis.api.symbols.KtJavaFieldSymbol @@ -44,12 +41,7 @@ class KSPropertyDeclarationJavaImpl private constructor(val ktJavaFieldSymbol: K } override fun findOverridee(): KSPropertyDeclaration? { - closestClassDeclaration()?.asStarProjectedType()?.let { - recordLookupWithSupertypes((it as KSTypeImpl).type) - } - recordLookupForPropertyOrMethod(this) - TODO("Not yet implemented") - // ?.also { recordLookupForPropertyOrMethod(it) } + return null } override fun asMemberOf(containing: KSType): KSType { diff --git a/test-utils/src/test/kotlin/com/google/devtools/ksp/test/KSPAATest.kt b/test-utils/src/test/kotlin/com/google/devtools/ksp/test/KSPAATest.kt index f5e7249f19..ef4f0008a3 100644 --- a/test-utils/src/test/kotlin/com/google/devtools/ksp/test/KSPAATest.kt +++ b/test-utils/src/test/kotlin/com/google/devtools/ksp/test/KSPAATest.kt @@ -409,7 +409,6 @@ class KSPAATest : AbstractKSPAATest() { runTest("../test-utils/testData/api/overridee/conflictingOverride.kt") } - @Disabled @TestMetadata("javaAccessor.kt") @Test fun testJavaAccessor() {