[FIR] Check isMember via the dispatch receiver
This commit is contained in:
committed by
Space Team
parent
553f400c25
commit
3014c7b353
@@ -599,11 +599,9 @@ fun FirFunctionSymbol<*>.isFunctionForExpectTypeFromCastFeature(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
fun getActualTargetList(container: FirAnnotationContainer): AnnotationTargetList {
|
||||
fun CallableId.isMember(): Boolean {
|
||||
return classId != null || isLocal // TODO: Replace with .containingClass (after fixing)
|
||||
}
|
||||
private val FirCallableDeclaration.isMember get() = dispatchReceiverType != null
|
||||
|
||||
fun getActualTargetList(container: FirAnnotationContainer): AnnotationTargetList {
|
||||
val annotated =
|
||||
if (container is FirBackingField && !container.propertySymbol.hasBackingField) container.propertyIfBackingField
|
||||
else container
|
||||
@@ -625,7 +623,7 @@ fun getActualTargetList(container: FirAnnotationContainer): AnnotationTargetList
|
||||
} else {
|
||||
TargetLists.T_LOCAL_VARIABLE
|
||||
}
|
||||
annotated.symbol.callableId.isMember() ->
|
||||
annotated.isMember ->
|
||||
if (annotated.source?.kind == KtFakeSourceElementKind.PropertyFromParameter) {
|
||||
TargetLists.T_VALUE_PARAMETER_WITH_VAL
|
||||
} else {
|
||||
@@ -648,7 +646,7 @@ fun getActualTargetList(container: FirAnnotationContainer): AnnotationTargetList
|
||||
is FirSimpleFunction -> {
|
||||
when {
|
||||
annotated.isLocal -> TargetLists.T_LOCAL_FUNCTION
|
||||
annotated.symbol.callableId.isMember() -> TargetLists.T_MEMBER_FUNCTION
|
||||
annotated.isMember -> TargetLists.T_MEMBER_FUNCTION
|
||||
else -> TargetLists.T_TOP_LEVEL_FUNCTION
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user