private static @Nullable PyType clarifyConstructorCallType(@NotNull ClarifiedResolveResult initOrNew,
                                                             @NotNull PyCallSiteExpression callSite,
                                                             @NotNull TypeEvalContext context) {
    final PyFunction initOrNewMethod = (PyFunction)initOrNew.myClarifiedResolved;
    final PyClass initOrNewClass = initOrNewMethod.getContainingClass();

    final PyClass receiverClass = ObjectUtils.notNull(
      PyUtil.as(initOrNew.myOriginalResolveResult.getElement(), PyClass.class),
      Objects.requireNonNull(initOrNewClass)
    );

    final PyType initOrNewCallType = initOrNewMethod.getCallType(context, callSite);
    if (receiverClass != initOrNewClass) {
      if (initOrNewCallType instanceof PyTupleType tupleType) {
        return new PyTupleType(receiverClass, tupleType.getElementTypes(), tupleType.isHomogeneous());
      }

      if (initOrNewCallType instanceof PyCollectionType) {
        final List<PyType> elementTypes = ((PyCollectionType)initOrNewCallType).getElementTypes();
        return new PyCollectionTypeImpl(receiverClass, false, elementTypes);
      }

      return new PyClassTypeImpl(receiverClass, false);
    }

    if (initOrNewCallType == null) {
      return PyUnionType.createWeakType(new PyClassTypeImpl(receiverClass, false));
    }

    return null;
  }
private static @Nullable PyType clarifyConstructorCallType(@NotNull ClarifiedResolveResult initOrNew,
                                                             @NotNull PyCallSiteExpression callSite,
                                                             @NotNull TypeEvalContext context)