Files
swift-mirror/test/Sema/availability_global_actor.swift
Ben Langmuir fd1875dcfb [test] Move availability tests to later fake OS versions
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.
2024-08-21 11:38:54 -07:00

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 {}