use of org.jetbrains.kotlin.ir.descriptors.IrBuiltinsPackageFragmentDescriptor in project kotlin by JetBrains.
the class KotlinTypeMapper method internalNameForPackageMemberOwner.
@NotNull
private String internalNameForPackageMemberOwner(@NotNull CallableMemberDescriptor descriptor, boolean publicFacade) {
boolean isAccessor = descriptor instanceof AccessorForCallableDescriptor;
if (isAccessor) {
descriptor = ((AccessorForCallableDescriptor) descriptor).getCalleeDescriptor();
}
KtFile file = DescriptorToSourceUtils.getContainingFile(descriptor);
if (file != null) {
Visibility visibility = descriptor.getVisibility();
if (!publicFacade || isNonConstProperty(descriptor) || Visibilities.isPrivate(visibility) || isAccessor) /*Cause of KT-9603*/
{
return FileClasses.getFileClassInternalName(fileClassesProvider, file);
} else {
return FileClasses.getFacadeClassInternalName(fileClassesProvider, file);
}
}
CallableMemberDescriptor directMember = DescriptorUtils.getDirectMember(descriptor);
if (directMember instanceof DeserializedCallableMemberDescriptor) {
String facadeFqName = getPackageMemberOwnerInternalName((DeserializedCallableMemberDescriptor) directMember, publicFacade);
if (facadeFqName != null)
return facadeFqName;
}
if (descriptor.getContainingDeclaration() instanceof IrBuiltinsPackageFragmentDescriptor) {
return descriptor.getContainingDeclaration().getName().asString();
}
throw new RuntimeException("Could not find package member for " + descriptor + " in package fragment " + descriptor.getContainingDeclaration());
}
Aggregations