From 738802c775ef08c74768747e3f8ccaf25087a0d2 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Tue, 7 Apr 2020 20:08:05 +0200 Subject: Fix adding `actual typealias` to annotation classes --- .../main/kotlin/transformers/documentables/ActualTypealiasAdder.kt | 6 ++++++ .../kotlin/transformers/documentables/DefaultDocumentableMerger.kt | 1 + 2 files changed, 7 insertions(+) (limited to 'plugins') diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt b/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt index b3282b03..35f27a94 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt @@ -49,6 +49,12 @@ class ActualTypealiasAdder : PreMergeDocumentableTransformer { ).let(::listOf), typealiases ) + is DAnnotation -> addActualTypeAlias( + it.copy( + classlikes = addActualTypeAliasToClasslikes(it.classlikes, typealiases) + ).let(::listOf), + typealiases + ) else -> throw IllegalStateException("${it::class.qualifiedName} ${it.name} cannot have extra added") } as List } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index ddb5903b..23a67804 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -139,6 +139,7 @@ fun DClasslike.setPlatformData(platformData: List): DClasslike = w is DEnum -> copy(platformData = platformData) is DInterface -> copy(platformData = platformData) is DObject -> copy(platformData = platformData) + is DAnnotation -> copy(platformData = platformData) else -> throw IllegalStateException("${this::class.qualifiedName} ${this.name} cannot have platform set") } -- cgit