Refactor FunctionHandle::isInterfaceDeclaration
- Give it more clear name mayBeUsedAsSuperImplementation because defining if it can be used as super-implementation this is what it used for - The meaning is negated, so it's needed to negate its usages and impls - Also, reuse it in findSuperImplementationForStubDelegation
This commit is contained in:
@@ -153,19 +153,19 @@ private fun <Signature> findSuperImplementationForStubDelegation(
|
||||
areDeclarationAndDefinitionSame: (CallableMemberDescriptor) -> Boolean,
|
||||
signatureByDescriptor: (FunctionDescriptor) -> Signature
|
||||
): FunctionDescriptor? {
|
||||
val implementation = findConcreteSuperDeclaration(DescriptorBasedFunctionHandle(function, areDeclarationAndDefinitionSame)).descriptor
|
||||
val implementation = findConcreteSuperDeclaration(DescriptorBasedFunctionHandle(function, areDeclarationAndDefinitionSame))
|
||||
|
||||
// Implementation from interface will be generated by common mechanism
|
||||
if (DescriptorUtils.isInterface(implementation.containingDeclaration)) return null
|
||||
if (!implementation.mayBeUsedAsSuperImplementation) return null
|
||||
|
||||
// Implementation in super-class already has proper signature
|
||||
if (signatureByDescriptor(function) == signatureByDescriptor(implementation)) return null
|
||||
if (signatureByDescriptor(function) == signatureByDescriptor(implementation.descriptor)) return null
|
||||
|
||||
assert(function.modality == Modality.OPEN) {
|
||||
"Should generate stubs only for non-abstract built-ins, but ${function.name} is ${function.modality}"
|
||||
}
|
||||
|
||||
return implementation
|
||||
return implementation.descriptor
|
||||
}
|
||||
|
||||
private fun findAllReachableDeclarations(
|
||||
|
||||
Reference in New Issue
Block a user