From ebe9e6db3737ff3fb7c8bc3858eaef02e602174d Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Wed, 29 Jun 2016 19:01:40 +0300 Subject: [PATCH] Type constructors with different counts of type parameters are not equal from now. --- .../jetbrains/kotlin/types/AbstractClassTypeConstructor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/AbstractClassTypeConstructor.java b/core/descriptors/src/org/jetbrains/kotlin/types/AbstractClassTypeConstructor.java index 3fb1052487c..411b37874d0 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/AbstractClassTypeConstructor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/AbstractClassTypeConstructor.java @@ -69,6 +69,10 @@ public abstract class AbstractClassTypeConstructor extends AbstractTypeConstruct // performance optimization: getFqName is slow method if (other.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. + if (((TypeConstructor) other).getParameters().size() != getParameters().size()) return false; + ClassifierDescriptor myDescriptor = getDeclarationDescriptor(); ClassifierDescriptor otherDescriptor = ((TypeConstructor) other).getDeclarationDescriptor();