If we fill in the implicit base type with what we expect the compiler to do for us, we get a different error:
ep?[ActualFoo.fooOne] // error: cannot convert value of type 'ActualFoo' to expected argument type 'ExtraProvider.Foo'
It looks like we're not inferring that ExtraProvider.Foo will always be the same type as BaseProvider.Foo. Note that we don't need the optional to reproduce this error, the same issue occurs if ep has static type ExtraProvider.
I believe this works from within ExtraProvider.foo because self has type Self, i.e., the dynamic, concrete conforming type.
I'm not sure if there's a technical reason why we couldn't consider this valid—it seems like we should have enough information in this case to know that ExtraProvider.Foo == ActualFoo for all conforming types, but there might be something I'm missing... ![]()