swift icon indicating copy to clipboard operation
swift copied to clipboard

[SR-2154] Don't allow wildcard platform in @available with version

Open devincoughlin opened this issue 10 years ago • 4 comments

Previous ID SR-2154
Radar None
Original Reporter @devincoughlin
Type Bug

Environment

Xcode 8

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @devincoughlin
Priority Medium

md5: e6fa577c28f75e0080ee0afd097a98f5

cloned from:

  • SR-2153 Deprecation warning despite #available check

Issue Description:

The Dispatch overlay currently has an availability attributes that like:

@available(*, deprecated: 8.0, message: "Use qos attributes instead")
public static let priorityBackground: DispatchQueue.GlobalAttributes

This says priorityBackground is deprecated on all OSes on version 8.0, which doesn't make any sense. (It would prevent a deprecation warning from being diagnosed on watchOS 2.0, for example.

It seems to me that Sema should treat the wildcard platform in an @available with a specific version as an error.

devincoughlin avatar Jul 23 '16 00:07 devincoughlin

Heck, Parse could probably treat it as an error.

belkadan avatar Jul 23 '16 01:07 belkadan

Yes, that's a good point.

devincoughlin avatar Jul 23 '16 01:07 devincoughlin

Is this resolved? If so, this should be closed.

Dante-Broggi avatar Sep 20 '18 19:09 Dante-Broggi

Swift 5.6 emits:

warning: unexpected version number in 'available' attribute for non-specific platform '*'

Closing.

tshortli avatar Jul 22 '22 06:07 tshortli