Cryptic "Will Never Be Fulfilled" Warning

I am trying to understand the "Will never be executed" warning here:

protocol FatalErrorReporterInterface {

    func fail(_ message: String) -> Never

}

final class FatalErrorReporter: FatalErrorReporterInterface {

    // This line emits "Will never be executed" warning
    func fail(_ message: String) -> Never {
        fatalError(message)
    }

}

      

Another compiler error?

+3


source to share


1 answer


Answered on Jordan Rose @Swift Evolution mailing list:

Of course it looks like me. In particular, it is similar to the SR-2729.

(I suspect this is because calling the method through the protocol generates a bit of wrapper code that then calls the original method; that wrapper code has no location of its own.)

Sorry to bother you Jordan



Link

https://bugs.swift.org/browse/SR-2729

0


source







All Articles