aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/links/DRI.kt4
-rw-r--r--core/src/main/kotlin/model/Documentable.kt16
2 files changed, 19 insertions, 1 deletions
diff --git a/core/src/main/kotlin/links/DRI.kt b/core/src/main/kotlin/links/DRI.kt
index abc88939..f961c982 100644
--- a/core/src/main/kotlin/links/DRI.kt
+++ b/core/src/main/kotlin/links/DRI.kt
@@ -33,7 +33,9 @@ data class DRI(
val params = callable?.let { listOfNotNull(it.extensionReceiverParameter) + it.valueParameters }.orEmpty()
DRI(
firstIsInstanceOrNull<PackageFragmentDescriptor>()?.fqName?.asString(),
- filterIsInstance<ClassDescriptor>().toList().takeIf { it.isNotEmpty() }?.asReversed()
+ (filterIsInstance<ClassDescriptor>() + filterIsInstance<TypeAliasDescriptor>()).toList()
+ .takeIf { it.isNotEmpty() }
+ ?.asReversed()
?.joinToString(separator = ".") { it.name.asString() },
callable?.let { Callable.from(it) },
firstIsInstanceOrNull<ParameterDescriptor>()?.let { params.indexOf(it) },
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index fec94537..42b49b82 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -140,6 +140,7 @@ data class DPackage(
override val functions: List<DFunction>,
override val properties: List<DProperty>,
override val classlikes: List<DClasslike>,
+ val typealiases: List<DTypeAlias>,
override val documentation: PlatformDependent<DocumentationNode>,
override val platformData: List<PlatformData>,
override val extra: PropertyContainer<DPackage> = PropertyContainer.empty()
@@ -344,6 +345,21 @@ data class DTypeParameter(
override fun withNewExtras(newExtras: PropertyContainer<DTypeParameter>) = copy(extra = newExtras)
}
+data class DTypeAlias(
+ override val dri: DRI,
+ override val name: String,
+ override val type: Bound,
+ val underlyingType: Bound,
+ override val documentation: PlatformDependent<DocumentationNode>,
+ override val platformData: List<PlatformData>,
+ override val extra: PropertyContainer<DTypeAlias> = PropertyContainer.empty()
+) : Documentable(), WithType, WithExtraProperties<DTypeAlias> {
+ override val children: List<Nothing>
+ get() = emptyList()
+
+ override fun withNewExtras(newExtras: PropertyContainer<DTypeAlias>) = copy(extra = newExtras)
+}
+
sealed class Projection
sealed class Bound : Projection()
data class OtherParameter(val name: String) : Bound()