diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-04-02 18:20:34 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-04-07 11:43:41 +0200 |
commit | af1ea32aa3f1e71cd47851a4a06344431801c8fd (patch) | |
tree | 906f1d7751780ba82dee91a4dbd7c29c585c52f9 /core/src/main/kotlin/model/aditionalExtras.kt | |
parent | fe24837fb51d5004ec3d7d728ce4c325a192e426 (diff) | |
download | dokka-af1ea32aa3f1e71cd47851a4a06344431801c8fd.tar.gz dokka-af1ea32aa3f1e71cd47851a4a06344431801c8fd.tar.bz2 dokka-af1ea32aa3f1e71cd47851a4a06344431801c8fd.zip |
Add Typealiases rendering and merging
Diffstat (limited to 'core/src/main/kotlin/model/aditionalExtras.kt')
-rw-r--r-- | core/src/main/kotlin/model/aditionalExtras.kt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/core/src/main/kotlin/model/aditionalExtras.kt b/core/src/main/kotlin/model/aditionalExtras.kt index af399745..58209939 100644 --- a/core/src/main/kotlin/model/aditionalExtras.kt +++ b/core/src/main/kotlin/model/aditionalExtras.kt @@ -28,8 +28,8 @@ class Annotations(val content: List<Annotation>) : ExtraProperty<Documentable> { override val key: ExtraProperty.Key<Documentable, *> = Annotations data class Annotation(val dri: DRI, val params: Map<String, String>) { - override fun equals(other: Any?): Boolean = when(other) { - is Annotation -> dri.equals(other.dri) + override fun equals(other: Any?): Boolean = when (other) { + is Annotation -> dri == other.dri else -> false } @@ -37,6 +37,18 @@ class Annotations(val content: List<Annotation>) : ExtraProperty<Documentable> { } } -object PrimaryConstructorExtra: ExtraProperty<DFunction>, ExtraProperty.Key<DFunction, PrimaryConstructorExtra> { +object PrimaryConstructorExtra : ExtraProperty<DFunction>, ExtraProperty.Key<DFunction, PrimaryConstructorExtra> { override val key: ExtraProperty.Key<DFunction, *> = this +} + +data class ActualTypealias(val underlyingType: PlatformDependent<Bound>) : ExtraProperty<DClasslike> { + companion object : ExtraProperty.Key<DClasslike, ActualTypealias> { + override fun mergeStrategyFor( + left: ActualTypealias, + right: ActualTypealias + ) = + MergeStrategy.Replace(ActualTypealias(PlatformDependent(left.underlyingType + right.underlyingType))) + } + + override val key: ExtraProperty.Key<DClasslike, ActualTypealias> = ActualTypealias }
\ No newline at end of file |