I have 2 follow-on questions:
Say if I have this declaration:
protocol ExampleProtocol {}
@available(macOS 10.12)
extension DateInterval: ExampleProtocol {}
and try to run it on macOS 10.11. The type DateInterval
isn't available on macOS 10.11. How does the compiler type check and compile it when it can't find the symbols?
By "#available
", do you mean #if
or if #available
? I assume it's #if
, because it seems to me that if the block of if #available
needs to be executable, then it needs to be type-checked and compiled.