Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-2155] Change interpretation of * in @available() #44763

Open
devincoughlin opened this issue Jul 23, 2016 · 0 comments
Open

[SR-2155] Change interpretation of * in @available() #44763

devincoughlin opened this issue Jul 23, 2016 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@devincoughlin
Copy link
Member

Previous ID SR-2155
Radar None
Original Reporter @devincoughlin
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: d6a2209861fe8c82d20c93d3100634a2

cloned from:

  • SR-2153 Deprecation warning despite #available check

Issue Description:

The current interpretation of * in @available is counter-intuitive and differs from its interpretation in #available.

Here is an example:

@available(OSX, deprecated=10.10)
@available(*, deprecated)
func foo() { }

Right now the compiler treats this as "foo() is deprecated on all versions of all platforms" – that is, the * wins over the OSX.

In my opinion a more natural interpretation of the above is: "foo() was deprecated on OSX in version 10.10 and is deprecated for all versions on all other platforms." It appears the authors of the Dispatch overlay thought similarly, because they used the above annotations thinking it had this second meaning (see https://bugs.swift.org/browse/SR-2153).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant