Vyas Ramasubramani created ARROW-18217:
------------------------------------------

             Summary: Multiple Filesystem subclasses are missing an override 
for Equals
                 Key: ARROW-18217
                 URL: https://issues.apache.org/jira/browse/ARROW-18217
             Project: Apache Arrow
          Issue Type: Bug
          Components: C++
    Affects Versions: 10.0.0, 9.0.0
            Reporter: Vyas Ramasubramani


Currently the `Filesystem` class contains two overloads for the `Equals` method:

```
virtual bool Equals(const FileSystem& other) const = 0;
virtual bool Equals(const std::shared_ptr<FileSystem>& other) const {
return Equals(*other);
}
```

The second is a trivial call to the first for ease of use. The first method is 
pure virtual and _must_ be overridden by subclasses. The problem is that 
overriding a single overload of a method also shadows all other overloads. As a 
result, it is no longer possible to call the `shared_ptr` version of the 
method. This appears to be the case for the `SubTreeFileSystem` and the 
`SlowFileSystem` in `filesystem.h` as well as the `S3FileSystem` in `s3fs.h`. 
There may be other classes with this problem as well, those are just the ones 
that I noticed. My guess is that what was intended here is to pull the method 
into the child class's namespace via a using declaration i.e. add `using 
FileSystem::Equals` to each child class.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to