Files
swift-mirror/test/attr/attr_availability_any_apple_os.swift
Allan Shortlidge 3b77e2e64a AST: Introduce experimental support for an anyAppleOS availability domain.
`anyAppleOS` represents a meta-platform for availability checks that can be
used to check availability across all of Apple's operating systems. It
supports versions 26.0 and up since version 26.0 is the first OS version number
that is aligned accross macOS, iOS, watchOS, tvOS, and visionOS.

Apple platform-specific availability specification take precedence over
`anyAppleOS` availability specifications when specified simultaneously.

Resolves rdar://153834380.
2025-10-31 15:21:30 -07:00

37 lines
1.1 KiB
Swift

// RUN: %target-typecheck-verify-swift -swift-version 5 -parse-as-library -enable-experimental-feature AnyAppleOSAvailability
// REQUIRES: swift_feature_AnyAppleOSAvailability
@available(anyAppleOS 26, *)
func availableIn26Short() { }
@available(anyAppleOS 26.0, *)
func availableIn26_0Short() { }
@available(AnyAppleOS 26, *) // expected-warning {{unrecognized platform name 'AnyAppleOS'; did you mean 'anyAppleOS'}}
func miscapitalized() { }
@available(anyAppleOS 25, *) // expected-warning {{'25' is not a valid version number for any Apple OS}}
func availableIn25Short() { }
@available(anyAppleOS 26, macOS 26, iOS 26, watchOS 26, tvOS 26, visionOS 26, *)
func availableIn26ShortWithPlatforms() { }
@available(anyAppleOS, introduced: 26)
func availableIn26() { }
@available(anyAppleOS, introduced: 26.0)
func availableIn26_0() { }
@available(anyAppleOS, obsoleted: 26)
func obsoletedIn26() { }
@available(anyAppleOS, deprecated: 26)
func deprecatedIn26() { }
@available(anyAppleOS, deprecated)
func deprecated() { }
@available(anyAppleOS, unavailable)
func unavailable() { }