diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/protoTypeTableUtil.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/protoTypeTableUtil.kt index cb85a54266a..064f3252cd2 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/protoTypeTableUtil.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/protoTypeTableUtil.kt @@ -17,10 +17,9 @@ package org.jetbrains.kotlin.serialization.deserialization import org.jetbrains.kotlin.metadata.ProtoBuf -import org.jetbrains.kotlin.utils.ifEmpty fun ProtoBuf.Class.supertypes(typeTable: TypeTable): List { - return supertypeList.ifEmpty { supertypeIdList.map { typeTable[it] } } + return supertypeList.takeIf(Collection<*>::isNotEmpty) ?: supertypeIdList.map { typeTable[it] } } fun ProtoBuf.Type.Argument.type(typeTable: TypeTable): ProtoBuf.Type? { @@ -40,7 +39,7 @@ fun ProtoBuf.Type.flexibleUpperBound(typeTable: TypeTable): ProtoBuf.Type? { } fun ProtoBuf.TypeParameter.upperBounds(typeTable: TypeTable): List { - return upperBoundList.ifEmpty { upperBoundIdList.map { typeTable[it] } } + return upperBoundList.takeIf(Collection<*>::isNotEmpty) ?: upperBoundIdList.map { typeTable[it] } } fun ProtoBuf.Function.returnType(typeTable: TypeTable): ProtoBuf.Type { @@ -102,4 +101,4 @@ fun ProtoBuf.TypeAlias.underlyingType(typeTable: TypeTable): ProtoBuf.Type = if (hasUnderlyingTypeId()) typeTable[underlyingTypeId] else underlyingType fun ProtoBuf.TypeAlias.expandedType(typeTable: TypeTable): ProtoBuf.Type = - if (hasExpandedTypeId()) typeTable[expandedTypeId] else expandedType \ No newline at end of file + if (hasExpandedTypeId()) typeTable[expandedTypeId] else expandedType