Search in sources :

Example 1 with RootContext

use of org.jetbrains.kotlin.codegen.context.RootContext in project kotlin by JetBrains.

the class JvmCodegenUtil method isCallInsideSameModuleAsDeclared.

public static boolean isCallInsideSameModuleAsDeclared(@NotNull CallableMemberDescriptor declarationDescriptor, @NotNull CodegenContext context, @Nullable File outDirectory) {
    if (context instanceof RootContext) {
        return true;
    }
    DeclarationDescriptor contextDescriptor = context.getContextDescriptor();
    CallableMemberDescriptor directMember = getDirectMember(declarationDescriptor);
    if (directMember instanceof DeserializedCallableMemberDescriptor) {
        return ModuleVisibilityUtilsKt.isContainedByCompiledPartOfOurModule(directMember, outDirectory);
    } else {
        return DescriptorUtils.areInSameModule(directMember, contextDescriptor);
    }
}
Also used : RootContext(org.jetbrains.kotlin.codegen.context.RootContext) DeserializedCallableMemberDescriptor(org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor) JavaCallableMemberDescriptor(org.jetbrains.kotlin.load.java.descriptors.JavaCallableMemberDescriptor) DeserializedCallableMemberDescriptor(org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor)

Aggregations

RootContext (org.jetbrains.kotlin.codegen.context.RootContext)1 JavaCallableMemberDescriptor (org.jetbrains.kotlin.load.java.descriptors.JavaCallableMemberDescriptor)1 DeserializedCallableMemberDescriptor (org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor)1