diff options
2 files changed, 18 insertions, 5 deletions
diff --git a/integration-tests/gradle/projects/it-js-ir-0/src/main/kotlin/RootPackageClass.kt b/integration-tests/gradle/projects/it-js-ir-0/src/main/kotlin/RootPackageClass.kt index 81c66d54..cbe6240e 100644 --- a/integration-tests/gradle/projects/it-js-ir-0/src/main/kotlin/RootPackageClass.kt +++ b/integration-tests/gradle/projects/it-js-ir-0/src/main/kotlin/RootPackageClass.kt @@ -1,6 +1,8 @@ @file:Suppress("unused") import org.w3c.dom.url.URLSearchParams +import org.w3c.dom.HTMLAnchorElement +import react.dom.html.AnchorHTMLAttributes import react.Props import react.State @@ -18,4 +20,7 @@ fun test(list: MutableList<Int>) = "list" @JsModule("is-sorted") @JsNonModule -external fun <T> sorted(a: Array<T>): Boolean
\ No newline at end of file +external fun <T> sorted(a: Array<T>): Boolean + +// this declaration can be used to check deserialization of dynamic type +external interface TextLinkProps: AnchorHTMLAttributes<HTMLAnchorElement>
\ No newline at end of file diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt index 93214592..353c71fb 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.analysis.resolve import org.jetbrains.kotlin.analyzer.* -import org.jetbrains.kotlin.builtins.konan.KonanBuiltIns +import org.jetbrains.kotlin.builtins.DefaultBuiltIns import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.container.StorageComponentContainer import org.jetbrains.kotlin.container.get @@ -14,14 +14,15 @@ import org.jetbrains.kotlin.idea.klib.createKlibPackageFragmentProvider import org.jetbrains.kotlin.incremental.components.LookupTracker import org.jetbrains.kotlin.js.resolve.JsPlatformAnalyzerServices import org.jetbrains.kotlin.konan.util.KlibMetadataFactories -import org.jetbrains.kotlin.library.metadata.NullFlexibleTypeDeserializer import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer import org.jetbrains.kotlin.resolve.SealedClassInheritorsProvider import org.jetbrains.kotlin.resolve.TargetEnvironment import org.jetbrains.kotlin.resolve.lazy.ResolveSession import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactoryService +import org.jetbrains.kotlin.serialization.js.DynamicTypeDeserializer import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil import org.jetbrains.kotlin.serialization.js.createKotlinJavascriptPackageFragmentProvider +import org.jetbrains.kotlin.serialization.konan.impl.KlibMetadataModuleDescriptorFactoryImpl import org.jetbrains.kotlin.utils.KotlinJavascriptMetadataUtils import java.io.File @@ -30,7 +31,14 @@ internal class DokkaJsResolverForModuleFactory( private val targetEnvironment: TargetEnvironment ) : ResolverForModuleFactory() { companion object { - private val metadataFactories = KlibMetadataFactories(::KonanBuiltIns, NullFlexibleTypeDeserializer) + private val metadataFactories = KlibMetadataFactories({ DefaultBuiltIns.Instance }, DynamicTypeDeserializer) + + private val metadataModuleDescriptorFactory = KlibMetadataModuleDescriptorFactoryImpl( + metadataFactories.DefaultDescriptorFactory, + metadataFactories.DefaultPackageFragmentsFactory, + metadataFactories.flexibleTypeDeserializer, + metadataFactories.platformDependentTypeTransformer + ) } override fun <M : ModuleInfo> createResolverForModule( @@ -82,7 +90,7 @@ internal class DokkaJsResolverForModuleFactory( moduleInfo.kotlinLibrary .createKlibPackageFragmentProvider( storageManager = moduleContext.storageManager, - metadataModuleDescriptorFactory = metadataFactories.DefaultDeserializedDescriptorFactory, + metadataModuleDescriptorFactory = metadataModuleDescriptorFactory, languageVersionSettings = languageVersionSettings, moduleDescriptor = moduleDescriptor, lookupTracker = LookupTracker.DO_NOTHING |