Filter out non-builtin package fragments from module when needed
In subsequent commits, a JVM module will be able to have up to two package fragments for a given package FQ name. For example, for package "kotlin" in kotlin-runtime.jar there will be a LazyJavaPackageFragment with binary (Kotlin+Java) dependencies, and a BuiltInsPackageFragment for built-ins metadata (which is loaded from kotlin/kotlin.kotlin_builtins)
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ class JvmBuiltInClassDescriptorFactory(
|
||||
) : ClassDescriptorFactory {
|
||||
private val cloneable by storageManager.createLazyValue {
|
||||
ClassDescriptorImpl(
|
||||
moduleDescriptor.getPackage(KOTLIN_FQ_NAME).fragments.single(),
|
||||
moduleDescriptor.getPackage(KOTLIN_FQ_NAME).fragments.filterIsInstance<BuiltInsPackageFragment>().single(),
|
||||
CLONEABLE_NAME, Modality.ABSTRACT, ClassKind.INTERFACE, listOf(moduleDescriptor.builtIns.anyType),
|
||||
SourceElement.NO_SOURCE
|
||||
).apply {
|
||||
|
||||
Reference in New Issue
Block a user