Contents

defaultIsolation(_:_:)

Set the default isolation to the given global actor type.

Declaration

static func defaultIsolation(_ isolation: MainActor.Type?, _ condition: BuildSettingCondition? = nil) -> SwiftSetting

Parameters

  • isolation:

    The type of global actor to use for default actor isolation inference. The only valid arguments are MainActor.self and nil.

  • condition:

    A condition that restricts the application of the build setting.

Discussion

The compiler defaults to inferring unannotated code as nonisolated if unspecified, or if the isolation parameter is set to nil.

See Also

Configuring Swift Settings