From 234169e34e4362e598e1cecb50f116c8c1ea74d2 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 3 Oct 2018 23:49:36 +0300 Subject: Fix platform merging on group by signature in overload group --- core/src/main/kotlin/Formats/StructuredFormatService.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 282ea7d6..f989fad6 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -381,8 +381,15 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, private fun formatOverloadGroup(items: List, isSingleNode: Boolean = false) { val platformsPerGroup = samePlatforms( - items.flatMap { if (it.kind == NodeKind.GroupNode) it.origins else listOf(it) } - .map { effectivePlatformsForNode(it) } + items.flatMap { + if (it.kind == NodeKind.GroupNode) { + it.origins.groupBy { origin -> + languageService.render(origin) + }.values.map { origins -> effectivePlatformsForMembers(origins) } + } else { + listOf(effectivePlatformsForNode(it)) + } + } ) if (platformsPerGroup) { -- cgit