boolean (@NotNull DeclarationDescriptor descriptor, @NotNull ModuleDescriptor module) { if (conf.renderDeclarationsFromOtherModules) return true; if (descriptor instanceof PackageViewDescriptor) { // PackageViewDescriptor does not belong to any module, so we check if one of its containing fragments is in our module for (PackageFragmentDescriptor fragment : ((PackageViewDescriptor) descriptor).getFragments()) { if (module.equals(DescriptorUtils.getContainingModule(fragment))) return true; } } // 'expected' declarations do not belong to the platform-specific module, even though they participate in the analysis if (descriptor instanceof MemberDescriptor && ((MemberDescriptor) descriptor).isExpect() && !TargetPlatformKt.isCommon(module.getPlatform())) return false; return module.equals(DescriptorUtils.getContainingModule(descriptor)); }