KotlinType (@NotNull CallableDescriptor descriptor) { KotlinType matchingReturnType = null; for (CallableDescriptor overriddenDescriptor : descriptor.getOverriddenDescriptors()) { KotlinType overriddenReturnType = overriddenDescriptor.getReturnType(); if (overriddenReturnType == null) { return null; } if (matchingReturnType == null || KotlinTypeChecker.DEFAULT.isSubtypeOf(overriddenReturnType, matchingReturnType)) { matchingReturnType = overriddenReturnType; } else if (!KotlinTypeChecker.DEFAULT.isSubtypeOf(matchingReturnType, overriddenReturnType)) { return null; } } return matchingReturnType; }