mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
10.50 was once greater than any real macOS version, but now it compares less than real released versions, which makes these tests depend on the deployment target unnecessarily. Update these tests to use even larger numbers to hopefully keep them independent a little longer.
38 lines
1.0 KiB
Swift
38 lines
1.0 KiB
Swift
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx50
|
|
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: OS=macosx
|
|
|
|
actor SomeActor {}
|
|
|
|
@globalActor struct AlwaysAvailableGA {
|
|
static let shared = SomeActor()
|
|
}
|
|
|
|
@available(macOS 51, *)
|
|
@globalActor struct Available51GA {
|
|
static let shared = SomeActor()
|
|
}
|
|
|
|
@available(*, unavailable)
|
|
@globalActor struct UnavailableGA { // expected-note {{'UnavailableGA' has been explicitly marked unavailable here}}
|
|
static let shared = SomeActor()
|
|
}
|
|
|
|
@AlwaysAvailableGA
|
|
struct AlwaysAvailableWithAlwaysAvailableGA {}
|
|
|
|
@Available51GA // expected-error {{'Available51GA' is only available in macOS 51 or newer}}
|
|
struct AlwaysAvailableWithAvailable51GA {} // expected-note {{add @available attribute to enclosing struct}}
|
|
|
|
@available(macOS 51, *)
|
|
@Available51GA
|
|
struct Always51WithAvailable51GA {}
|
|
|
|
@UnavailableGA // expected-error {{'UnavailableGA' is unavailable}}
|
|
struct AlwaysAvailableWithUnavailableGA {}
|
|
|
|
@available(*, unavailable)
|
|
@UnavailableGA
|
|
struct UnavailableWithUnavailableGA {}
|