Do not force overridden descriptors computation
Currently 'overriddenDescriptors' of substituted function is lazy and in most cases it's unnecessary to compute it (it's enough to use the same field from 'original')
This commit is contained in:
@@ -77,7 +77,7 @@ fun getEffectiveVariance(parameterVariance: Variance, projectionKind: Variance):
|
||||
val CallableDescriptor?.isMethodWithDeclarationSiteWildcards: Boolean
|
||||
get() {
|
||||
if (this !is CallableMemberDescriptor) return false
|
||||
return firstOverridden {
|
||||
return original.firstOverridden(useOriginal = true) {
|
||||
METHODS_WITH_DECLARATION_SITE_WILDCARDS.contains(it.propertyIfAccessor.fqNameOrNull())
|
||||
} != null
|
||||
}
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ public class SamAdapterOverridabilityCondition implements ExternalOverridability
|
||||
return new SamAdapterInfo(samAdapter, ownerType);
|
||||
}
|
||||
|
||||
for (CallableMemberDescriptor overridden : samAdapter.getOverriddenDescriptors()) {
|
||||
for (CallableMemberDescriptor overridden : samAdapter.getOriginal().getOverriddenDescriptors()) {
|
||||
ClassDescriptor containingClass = (ClassDescriptor) overridden.getContainingDeclaration();
|
||||
|
||||
for (KotlinType immediateSupertype : TypeUtils.getImmediateSupertypes(ownerType)) {
|
||||
|
||||
@@ -99,7 +99,7 @@ private fun deprecationByOverridden(root: CallableMemberDescriptor): Deprecation
|
||||
visited.add(node)
|
||||
|
||||
val deprecatedAnnotation = node.getDeprecationByAnnotation()
|
||||
val overriddenDescriptors = node.overriddenDescriptors
|
||||
val overriddenDescriptors = node.original.overriddenDescriptors
|
||||
when {
|
||||
deprecatedAnnotation != null -> {
|
||||
deprecations.add(deprecatedAnnotation)
|
||||
|
||||
Reference in New Issue
Block a user