diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-17 09:25:02 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-17 11:52:28 +0200 |
commit | b439f0f4da19273a1b60df45aa380ecf2511de73 (patch) | |
tree | 99d0b365ea6f5875eb22154ba912f784a874d889 /core | |
parent | 89ddbd2603e24a349314c4be151edb25f0d2af31 (diff) | |
download | dokka-b439f0f4da19273a1b60df45aa380ecf2511de73.tar.gz dokka-b439f0f4da19273a1b60df45aa380ecf2511de73.tar.bz2 dokka-b439f0f4da19273a1b60df45aa380ecf2511de73.zip |
ContentNodes: Explicitly check types of children
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/pages/ContentNodes.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index 0d43d062..f068dd7a 100644 --- a/core/src/main/kotlin/pages/ContentNodes.kt +++ b/core/src/main/kotlin/pages/ContentNodes.kt @@ -191,7 +191,7 @@ data class ContentTable( override fun withNewExtras(newExtras: PropertyContainer<ContentNode>): ContentTable = copy(extra = newExtras) override fun transformChildren(transformer: (ContentNode) -> ContentNode): ContentTable = - copy(children = children.map(transformer).filterIsInstance<ContentGroup>()) + copy(children = children.map(transformer).map { it as ContentGroup }) override fun withSourceSets(sourceSets: Set<ContentSourceSet>): ContentTable = copy(sourceSets = sourceSets) @@ -253,7 +253,7 @@ data class ContentDivergentGroup( copy(extra = newExtras) override fun transformChildren(transformer: (ContentNode) -> ContentNode): ContentDivergentGroup = - copy(children = children.map(transformer).filterIsInstance<ContentDivergentInstance>()) + copy(children = children.map(transformer).map { it as ContentDivergentInstance }) // TODO NOW? override fun withSourceSets(sourceSets: Set<ContentSourceSet>): ContentDivergentGroup = this |