mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The `@MainActor` global actor constraint on a declaration does not carry an inherent ABI impact and therefore use of this constraint should not be limited to OS versions where Swift concurrency is available. Resolves rdar://105610970
21 lines
443 B
Swift
21 lines
443 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
// This test is meant to verify that a @MainActor constraint is accepted without
|
|
// any availability restrictions for all targets.
|
|
|
|
@MainActor
|
|
struct AlwaysAvailable {}
|
|
|
|
@MainActor(unsafe)
|
|
struct AlwaysAvailableUnsafe {}
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
@MainActor
|
|
struct AvailableSwift5_1 {}
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
@MainActor(unsafe)
|
|
struct AvailableSwift5_1Unsafe {}
|