swift-system icon indicating copy to clipboard operation
swift-system copied to clipboard

Deprecated APIs are lacking availability information

Open karwa opened this issue 3 years ago • 2 comments

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)

karwa avatar Nov 09 '22 07:11 karwa

Linked to rdar://111935931

glessard avatar Jul 08 '23 00:07 glessard

This is fixed in macOS 14.4 and iOS 17.4.

glessard avatar May 20 '24 18:05 glessard

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.

glessard avatar Jun 13 '24 20:06 glessard