diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-09-08 17:03:31 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-09-10 13:11:02 +0200 |
commit | 37db297bfc00a12114122db06f34091528ed03e3 (patch) | |
tree | 17c4140d6286fbee1e312be952a5af6512a5d232 /plugins/base/src/main/kotlin/translators/descriptors | |
parent | 79ab595fe44c3588ae07cd5130bb9d63d6085f07 (diff) | |
download | dokka-37db297bfc00a12114122db06f34091528ed03e3.tar.gz dokka-37db297bfc00a12114122db06f34091528ed03e3.tar.bz2 dokka-37db297bfc00a12114122db06f34091528ed03e3.zip |
Fix presentation of typealiases
Diffstat (limited to 'plugins/base/src/main/kotlin/translators/descriptors')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 5e6f8f20..d42acb32 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -631,20 +631,26 @@ private class DokkaDescriptorVisitor( private fun KotlinType.toBound(): Bound = when (this) { is DynamicType -> Dynamic - else -> when (val ctor = constructor.declarationDescriptor) { - is TypeParameterDescriptor -> TypeParameter( - dri = DRI.from(ctor), - name = ctor.name.asString() - ) - else -> TypeConstructor( - DRI.from(ctor!!), // TODO: remove '!!' - arguments.map { it.toProjection() }, - if (isExtensionFunctionType) FunctionModifiers.EXTENSION - else if (isFunctionType) FunctionModifiers.FUNCTION - else FunctionModifiers.NONE - ) - }.let { - if (isMarkedNullable) Nullable(it) else it + else -> { + val ctor = when (this) { + is AbbreviatedType -> abbreviation.constructor.declarationDescriptor + else -> constructor.declarationDescriptor + } + when (ctor) { + is TypeParameterDescriptor -> TypeParameter( + dri = DRI.from(ctor), + name = ctor.name.asString() + ) + else -> TypeConstructor( + DRI.from(ctor!!), // TODO: remove '!!' + arguments.map { it.toProjection() }, + if (isExtensionFunctionType) FunctionModifiers.EXTENSION + else if (isFunctionType) FunctionModifiers.FUNCTION + else FunctionModifiers.NONE + ) + }.let { + if (isMarkedNullable) Nullable(it) else it + } } } |