Okay, but doesn't Bar nevertheless inherit Foo's methods in the sense of interface inheritance? Or does code that gets passed a Bar not get access to Foo's methods?
does code that gets passed a Bar not get access to Foo's methods
Prior to the current version of Rust it was impossible to access methods on `Foo` when a `&dyn Bar` was passed. With the current beta version you can upcast.
Comments
Okay, but doesn't Bar nevertheless inherit Foo's methods in the sense of interface inheritance? Or does code that gets passed a Bar not get access to Foo's methods?
Prior to the current version of Rust it was impossible to access methods on `Foo` when a `&dyn Bar` was passed. With the current beta version you can upcast.
This has been working since Rust 1.0, I think:
> With the current beta version you can upcastRight. Now you can convert from `&dyn Bar` to `&dyn Foo` which wasn't possible before.
Inherent method implementations were unavailable. (Eg: impl dyn Foo) and then call this via Bar.