use of org.jetbrains.kotlin.builtins.BuiltInsPackageFragment in project kotlin by JetBrains.
the class KotlinTypeMapper method getPackageMemberContainingClassesInfo.
@Nullable
private static ContainingClassesInfo getPackageMemberContainingClassesInfo(@NotNull DeserializedCallableMemberDescriptor descriptor) {
DeclarationDescriptor containingDeclaration = descriptor.getContainingDeclaration();
if (containingDeclaration instanceof BuiltInsPackageFragment) {
return new ContainingClassesInfo(FAKE_CLASS_ID_FOR_BUILTINS, FAKE_CLASS_ID_FOR_BUILTINS);
}
Name implClassName = JvmFileClassUtil.getImplClassName(descriptor);
assert implClassName != null : "No implClassName for " + descriptor;
String implSimpleName = implClassName.asString();
String facadeSimpleName;
if (containingDeclaration instanceof LazyJavaPackageFragment) {
facadeSimpleName = ((LazyJavaPackageFragment) containingDeclaration).getFacadeSimpleNameForPartSimpleName(implSimpleName);
if (facadeSimpleName == null)
return null;
} else if (containingDeclaration instanceof IncrementalMultifileClassPackageFragment) {
facadeSimpleName = ((IncrementalMultifileClassPackageFragment) containingDeclaration).getMultifileClassName().asString();
} else {
throw new AssertionError("Unexpected package fragment for " + descriptor + ": " + containingDeclaration + " (" + containingDeclaration.getClass().getSimpleName() + ")");
}
return ContainingClassesInfo.forPackageMember(((PackageFragmentDescriptor) containingDeclaration).getFqName(), facadeSimpleName, implSimpleName);
}
Aggregations