private static @Nullable PyType replaceLiteralStringWithStr(@Nullable PyType actual) {
    // TODO replace with PyTypeVisitor API once it's ready
    if (actual instanceof PyLiteralStringType literalStringType) {
      return new PyClassTypeImpl(literalStringType.getPyClass(), false);
    }
    if (actual instanceof PyUnionType unionType) {
      return unionType.map(PyTypeChecker::replaceLiteralStringWithStr);
    }
    if (actual instanceof PyNamedTupleType) {
      return actual;
    }
    if (actual instanceof PyTupleType tupleType) {
      return new PyTupleType(tupleType.getPyClass(),
                             ContainerUtil.map(tupleType.getElementTypes(), PyTypeChecker::replaceLiteralStringWithStr),
                             tupleType.isHomogeneous(), tupleType.isDefinition());
    }
    if (actual instanceof PyCollectionType generic) {
      return new PyCollectionTypeImpl(generic.getPyClass(), generic.isDefinition(),
                                      ContainerUtil.map(generic.getElementTypes(), PyTypeChecker::replaceLiteralStringWithStr));
    }
    return actual;
  }
private static @Nullable PyType replaceLiteralStringWithStr(@Nullable PyType actual)