apple / swift-system

Low-level system calls and types for Swift
Apache License 2.0
1.18k stars 102 forks source link

Deprecated APIs are lacking availability information #114

Closed karwa closed 4 months ago

karwa commented 1 year ago

I have a function which makes use of FilePath(cString:), so it can be used as far back as macOS 11/iOS 14.

Now, I'm getting a warning that that initializer has been deprecated (in favour of platformString:). That's fine, but I'd still like to make use of the old initializer on those older OSes. Unfortunately, even when I only use the deprecated initializer on a fallback path, I still get warnings:

image

I believe the reason for this is that the @available annotations do not include version information. It is possible to write something like:

@available(macOS, introduced: 11, deprecated: 12)

glessard commented 1 year ago

Linked to rdar://111935931

glessard commented 5 months ago

This is fixed in macOS 14.4 and iOS 17.4.

glessard commented 4 months ago

Fixed in macOS 14.4 and iOS 17.4 (and other corresponding releases). The deprecated API now include introduction versions in the SDK version of swift-system.