From b439f0f4da19273a1b60df45aa380ecf2511de73 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 17 Aug 2020 09:25:02 +0200 Subject: ContentNodes: Explicitly check types of children --- core/src/main/kotlin/pages/ContentNodes.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') 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): ContentTable = copy(extra = newExtras) override fun transformChildren(transformer: (ContentNode) -> ContentNode): ContentTable = - copy(children = children.map(transformer).filterIsInstance()) + copy(children = children.map(transformer).map { it as ContentGroup }) override fun withSourceSets(sourceSets: Set): 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()) + copy(children = children.map(transformer).map { it as ContentDivergentInstance }) // TODO NOW? override fun withSourceSets(sourceSets: Set): ContentDivergentGroup = this -- cgit