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();