mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Global actor kind also appends type offset that indicates what global actor to use with the type. All of the isolation kinds should be placed above it to make sure that there is never a clash when i.e. `MainActor` is serialized as id `1`. Resolves: rdar://153487603
31 lines
848 B
Swift
31 lines
848 B
Swift
// RUN: %empty-directory(%t/src)
|
|
// RUN: split-file %s %t/src
|
|
|
|
/// Build the library A
|
|
// RUN: %target-swift-frontend -emit-module %t/src/A.swift \
|
|
// RUN: -module-name A -swift-version 6 -enable-library-evolution \
|
|
// RUN: -emit-module-path %t/A.swiftmodule \
|
|
// RUN: -emit-module-interface-path %t/A.swiftinterface
|
|
|
|
// Build the client using module
|
|
// RUN: %target-swift-emit-sil -verify -module-name Client -I %t %t/src/Client.swift
|
|
|
|
// RUN: rm %t/A.swiftmodule
|
|
|
|
// Re-build the client using interface
|
|
// RUN: %target-swift-emit-sil -verify -module-name Client -I %t %t/src/Client.swift
|
|
|
|
//--- A.swift
|
|
@MainActor
|
|
public final class Test {
|
|
public func test(_: @escaping @Sendable @MainActor () -> Void) {}
|
|
}
|
|
|
|
//--- Client.swift
|
|
import A
|
|
|
|
@MainActor
|
|
func test(t: Test, fn: @escaping @Sendable @MainActor () -> Void) {
|
|
t.test(fn) // Ok
|
|
}
|