From 67e91b7ebdc5d3627e2892c2e156989b6e5be732 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 17 Feb 2021 16:39:19 +0100 Subject: [PATCH] Minor, add workaround for KT-45008 --- .../src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt b/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt index d3a4e02c62f..b77c41f87a0 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt @@ -153,7 +153,8 @@ abstract class AbstractTypeConstructor(storageManager: StorageManager) : TypeCon if (other !is TypeConstructor) return false // performance optimization: getFqName is slow method - if (other.hashCode() != hashCode()) return false + // Cast to Any is needed as a workaround for KT-45008. + if ((other as Any).hashCode() != hashCode()) return false // Sometimes we can get two classes from different modules with different counts of type parameters. // To avoid problems in type checker we suppose that it is different type constructors.