10 years on, what would you change about Swift?

This won’t be required in Swift 6 by default. But that’s not main question, since Service and any Service here is the same thing, just second one is explicit. And if there are any performance implications you are concerned using existential, it is fine to use any (especially if alternatives are unavailable or fit less). It is good to prefer generic/some (since generics itself has a viral tendency) if possible, but still if that is not a critical part, you it won’t have performance implications.

1 Like