Skip to content

Allow @available(swift, ...) nested within @available(macOS, ...) #15213

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

Merged

Conversation

jrose-apple
Copy link
Contributor

Previously, we treated this as an attempt to widen the availability of a member beyond its context, but it's really a different axis of availability.

Also, warn about using @available on extensions without an OS, which we just completely ignore right now.

rdar://problem/32632327

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@Coeur
Copy link
Contributor

Coeur commented Mar 14, 2018

What about a test for multiple attributes, like:

@available(macOS 10.12, *)
@available(swift 400)
extension DummyType {}

and

@available(swift 400)
@available(macOS 10.12, *)
extension DummyType {}

Should it warn?

@jrose-apple
Copy link
Contributor Author

Ah, I see no reason why the existing code wouldn't work for that, but it's a good test to have! Thanks for the suggestion.

Previously, we treated this as an attempt to widen the availability
of a member beyond its context, but it's really a different axis of
availability.

Also, warn about using @available on extensions without an OS, which
we just completely ignore right now.

rdar://problem/32632327
It looks like we exposed a bunch of Metal APIs to Swift 3 that we
didn't mean to; at this point it would be a source-breaking change to
hide them. Oops.
@jrose-apple jrose-apple force-pushed the avail-yourself-of-this-patch branch from 75d107a to 74a4adc Compare March 14, 2018 23:39
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple requested a review from moiseev March 14, 2018 23:39
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 75d107a5d47c9a08b554d3ef5b22e03c115bbcde

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 75d107a5d47c9a08b554d3ef5b22e03c115bbcde

Copy link
Contributor

@moiseev moiseev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jrose-apple
Copy link
Contributor Author

jrose-apple commented Mar 15, 2018

Hm, it's the two failures that @davezarzycki was seeing earlier. Except I did rebase…

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test macOS

@davezarzycki
Copy link
Contributor

Hi @jrose-apple – I may be grasping at straws here, but I'm seeing seemingly random but repeatable/inexplicable test time outs in other scenarios too. For example, @xedin made what a seemingly harmless change in #15134 that caused two simple/fast tests to start timing out on my Linux box. Do the timeouts in this pull request go away if you remove -swift-verion 3? That worked on my Linux box for #15134.

@xedin
Copy link
Contributor

xedin commented Mar 15, 2018

It seems like these failures are sporadic, I saw them happen couple of times on Linux CI even before my changes went in.

@jrose-apple
Copy link
Contributor Author

I'm not sure that what you saw on Linux was related to the OpenCL and SceneKit tests on macOS, because it's always those two tests. I asked Mishal to take a look at the particular bot that's been running our tests—turns out it was one specific machine for at least my failure and one of yours—and he said he'd take it offline for now.

Linux tests have been bumping up against the timeouts for a while over the last few months. I wonder if there are one or two long-running tests there and/or if we've regressed on something, but no one's looked into it yet that I know of.

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

@jrose-apple jrose-apple merged commit 0671848 into swiftlang:master Mar 15, 2018
@jrose-apple jrose-apple deleted the avail-yourself-of-this-patch branch March 15, 2018 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants