Files
swift-mirror/test/Sema/availability_main_actor.swift
Allan Shortlidge fb03b4aa04 Sema: Relax availability checking for @MainActor.
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
2023-03-16 14:23:36 -07:00

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