Files
swift-mirror/test/Availability/availability_global_actor.swift
Allan Shortlidge 897a74f495 Tests: Move some availability tests into a new test/Availability directory.
Un-reverts 9c01ee2c1b.

Also, add myself as a reviewer for more availability related files.

NFC.
2025-06-23 15:57:34 -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 {}