8000 special handling for java property accessors override checking by neetopia · Pull Request #1894 · google/ksp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

special handling for java property accessors override checking #1894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ class KSPAATest : AbstractKSPAATest() {
runTest("../test-utils/testData/api/overridee/conflictingOverride.kt")
}

@Disabled
@TestMetadata("javaAccessor.kt")
@Test
fun testJavaAccessor() {
Expand Down
Loading
0