From 76b7cb319363928a76aae53e1512702fa57e6e9e Mon Sep 17 00:00:00 2001 From: Irene Dea Date: Tue, 4 Jan 2022 11:54:14 -0800 Subject: [PATCH] Fix hasCustomAttributes --- .../src/org/jetbrains/kotlin/types/TypeAttributes.kt | 2 -- .../jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeAttributes.kt b/core/descriptors/src/org/jetbrains/kotlin/types/TypeAttributes.kt index 2ddf3c769ad..9d202a1214b 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeAttributes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeAttributes.kt @@ -70,8 +70,6 @@ class TypeAttributes private constructor(attributes: List>) : A } } - val size: Int get() = arrayMap.size - fun union(other: TypeAttributes): TypeAttributes { return perform(other) { this.union(it) } } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt index cb33caeb1bd..c81009fca55 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt @@ -677,7 +677,7 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy override fun KotlinTypeMarker.hasCustomAttributes(): Boolean { require(this is KotlinType, this::errorMessage) - return this.attributes.size > 1 + return !this.attributes.isEmpty() && this.getCustomAttributes().size > 0 } override fun KotlinTypeMarker.getCustomAttributes(): List {