Being able to fully qualify a protocol conformance

I often find that as APIs evolve some protocol requirements are lifted, however, there is no indication of that in the conforming type. What I would like is to be able to fully qualify a function name by indicating the protocol in the function signature like so:

protocol User {
    var action()

class _User {
    func User.action() {
        // do stuff.

This way if that requirement were to ever be removed from the protocol, then a compiler warning could be triggered indicating that User no longer has this requirement. This would help me keep cleaner code by reminding me to remove code that is no longer used, or explicitly adopt it as an internal utility in the class by removing the qualifier.


You can see a recent discussion about this in a similar thread.

1 Like