Skip to content

@MainActor in bridged code uses MainActor.assumeIsolated which is only available in iOS 17 #56

@marcprux

Description

@marcprux

The CI failure on macOS 13 raises the issue of:

@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
nonisolated public func assumeIsolated<T>(_ operation: (isolated Self) throws -> T, file: StaticString = #fileID, line: UInt = #line) rethrows -> T where T : Sendable

resulting in this test failure:

/Users/runner/work/skip-bridge/skip-bridge/.build/plugins/outputs/skip-bridge/SkipBridgeToKotlinSamplesTests/skipstone/SkipBridgeToKotlinSamples/.build/SkipBridgeToKotlinSamples/swift/plugins/outputs/swift/SkipBridgeToKotlinSamples/skipstone/SkipBridgeGenerated/Samples_Bridge.swift:854:22: error: 'assumeIsolated(_:file:line:)' is only available in macOS 14.0 or newer
    return MainActor.assumeIsolated {

There may be no solution other than documenting that @ MainActor is limited to iOS 17+.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions