boolean (@NotNull PyCollectionType expected, @NotNull PyClassType actual, @NotNull MatchContext context) { if (actual instanceof PyCollectionType && expected.getPyClass().equals(actual.getPyClass())) { return matchGenericClassesParameterWise(expected, (PyCollectionType)actual, context); } PyCollectionType expectedGenericType = findGenericDefinitionType(expected.getPyClass(), context.context); if (expectedGenericType != null) { GenericSubstitutions actualSubstitutions = collectTypeSubstitutions(actual, context.context); PyCollectionType concreteExpected = (PyCollectionType)substitute(expectedGenericType, actualSubstitutions, context.context); assert concreteExpected != null; return matchGenericClassesParameterWise(expected, concreteExpected, context); } return true; }