[FIR] fix implementation status for Java fields and synthetic properties
^KTIJ-23963 Fixed
This commit is contained in:
committed by
teamcity
parent
a5f48e295e
commit
a5d8429515
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.fir.expressions.*
|
|||||||
import org.jetbrains.kotlin.fir.expressions.impl.FirEmptyExpressionBlock
|
import org.jetbrains.kotlin.fir.expressions.impl.FirEmptyExpressionBlock
|
||||||
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
||||||
import org.jetbrains.kotlin.fir.references.toResolvedCallableSymbol
|
import org.jetbrains.kotlin.fir.references.toResolvedCallableSymbol
|
||||||
import org.jetbrains.kotlin.fir.declarations.fullyExpandedClass
|
|
||||||
import org.jetbrains.kotlin.fir.resolve.*
|
import org.jetbrains.kotlin.fir.resolve.*
|
||||||
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
||||||
import org.jetbrains.kotlin.fir.scopes.*
|
import org.jetbrains.kotlin.fir.scopes.*
|
||||||
@@ -346,15 +345,24 @@ fun FirCallableSymbol<*>.getImplementationStatus(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this is FirNamedFunctionSymbol) {
|
|
||||||
if (parentClassSymbol is FirRegularClassSymbol && parentClassSymbol.isData && matchesDataClassSyntheticMemberSignatures) {
|
when (symbol) {
|
||||||
return ImplementationStatus.INHERITED_OR_SYNTHESIZED
|
is FirNamedFunctionSymbol -> {
|
||||||
}
|
if (
|
||||||
// TODO: suspend function overridden by a Java class in the middle is not properly regarded as an override
|
parentClassSymbol is FirRegularClassSymbol &&
|
||||||
if (isSuspend) {
|
parentClassSymbol.isData &&
|
||||||
return ImplementationStatus.INHERITED_OR_SYNTHESIZED
|
symbol.matchesDataClassSyntheticMemberSignatures
|
||||||
|
) {
|
||||||
|
return ImplementationStatus.INHERITED_OR_SYNTHESIZED
|
||||||
|
}
|
||||||
|
// TODO: suspend function overridden by a Java class in the middle is not properly regarded as an override
|
||||||
|
if (isSuspend) {
|
||||||
|
return ImplementationStatus.INHERITED_OR_SYNTHESIZED
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
is FirFieldSymbol -> if (symbol.isJavaOrEnhancement) return ImplementationStatus.CANNOT_BE_IMPLEMENTED
|
||||||
}
|
}
|
||||||
|
|
||||||
return when {
|
return when {
|
||||||
isFinal -> ImplementationStatus.CANNOT_BE_IMPLEMENTED
|
isFinal -> ImplementationStatus.CANNOT_BE_IMPLEMENTED
|
||||||
containingClassSymbol === parentClassSymbol && (origin == FirDeclarationOrigin.Source || origin == FirDeclarationOrigin.Precompiled) ->
|
containingClassSymbol === parentClassSymbol && (origin == FirDeclarationOrigin.Source || origin == FirDeclarationOrigin.Precompiled) ->
|
||||||
|
|||||||
Reference in New Issue
Block a user