Files
swift-mirror/stdlib/public/core/SwiftSettings.swift
Michael Gottesman f64dd5a8d5 [concurrency] Add initial support for SwiftSettings to control defaultIsolation at the file level.
We introduce a new macro called #SwiftSettings that can be used in conjunction
with a new stdlib type called SwiftSetting to control the default isolation at
the file level. It overrides the current default isolation whether it is the
current nonisolated state or main actor (when -enable-experimental-feature
UnspecifiedMeansMainActorIsolated is set).
2025-03-10 17:33:45 -07:00

28 lines
843 B
Swift

//===--- SwiftSettings.swift ----------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#if $Macros
@available(SwiftStdlib 9999, *)
public struct SwiftSetting {
public init() {
fatalError("A SwiftSetting should never actually be constructed")
}
}
@available(SwiftStdlib 9999, *)
@freestanding(declaration)
public macro SwiftSettings(_ settings: SwiftSetting...) =
Builtin.SwiftSettingsMacro
#endif