Hmm. I tried something like the code you sent, and same as you, it compiled. But when I changed iOS to macOS in the availability macro (which I assume is what you intended to write), then I get the compile error... weird... this is also the case if I change FSVolume.MountOptions to something like Int, so it's not because the FSKit types are macOS only.
Here's some sample code that reproduces this (also added the code to my feedback):
@objc protocol SwiftProtocol {
@available(macOS 26.0, *)
@objc optional var requestedFoo: Int { get set }
}
class ReproduceBug: SwiftProtocol {
@available(macOS 26.2, *)
var requestedFoo: Int {
get { 0 }
set {}
}
}
Topic:
App & System Services
SubTopic:
Core OS
Tags: