From 5702fb3b2230d68d56ea0ef97ad5a062b892573a Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 25 Aug 2020 18:09:49 +0300 Subject: [PATCH] FIR: fix CCE in AttributeArrayOwner --- .../jetbrains/kotlin/fir/utils/AttributeArrayOwner.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/utils/AttributeArrayOwner.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/utils/AttributeArrayOwner.kt index e0c4881d21e..1d5b2360fd8 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/utils/AttributeArrayOwner.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/utils/AttributeArrayOwner.kt @@ -31,9 +31,13 @@ abstract class AttributeArrayOwner : AbstractArrayMapOwner { - arrayMap = ArrayMapImpl().apply { - val map = arrayMap as OneElementArrayMap - this[map.index] = map.value + val map = arrayMap as OneElementArrayMap + if (map.index == id) { + arrayMap = OneElementArrayMap(value, id) + return + } else { + arrayMap = ArrayMapImpl() + arrayMap[map.index] = map.value } } }