Skip to content

Commit a5f1d3d

Browse files
authored
Merge pull request #83047 from xedin/rdar-153487603
[Serialization] Move `nonisolated(nonsending)` isolation kind above g…
2 parents 1f9d70f + ace6f73 commit a5f1d3d

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

lib/Serialization/ModuleFormat.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5858
/// describe what change you made. The content of this comment isn't important;
5959
/// it just ensures a conflict if two people change the module format.
6060
/// Don't worry about adhering to the 80-column limit for this line.
61-
const uint16_t SWIFTMODULE_VERSION_MINOR = 955; // Lifetime dependencies on enum element
61+
const uint16_t SWIFTMODULE_VERSION_MINOR = 956; // nonisolated(nonsending) isolation was moved
6262

6363
/// A standard hash seed used for all string hashes in a serialized module.
6464
///
@@ -707,8 +707,9 @@ enum class FunctionTypeIsolation : uint8_t {
707707
NonIsolated,
708708
Parameter,
709709
Erased,
710-
GlobalActorOffset, // Add this to the global actor type ID
711710
NonIsolatedCaller,
711+
// NOTE: All of the new kinds should be added above.
712+
GlobalActorOffset, // Add this to the global actor type ID
712713
};
713714
using FunctionTypeIsolationField = TypeIDField;
714715

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: %empty-directory(%t/src)
2+
// RUN: split-file %s %t/src
3+
4+
/// Build the library A
5+
// RUN: %target-swift-frontend -emit-module %t/src/A.swift \
6+
// RUN: -module-name A -swift-version 6 -enable-library-evolution \
7+
// RUN: -emit-module-path %t/A.swiftmodule \
8+
// RUN: -emit-module-interface-path %t/A.swiftinterface
9+
10+
// Build the client using module
11+
// RUN: %target-swift-emit-sil -verify -module-name Client -I %t %t/src/Client.swift
12+
13+
// RUN: rm %t/A.swiftmodule
14+
15+
// Re-build the client using interface
16+
// RUN: %target-swift-emit-sil -verify -module-name Client -I %t %t/src/Client.swift
17+
18+
//--- A.swift
19+
@MainActor
20+
public final class Test {
21+
public func test(_: @escaping @Sendable @MainActor () -> Void) {}
22+
}
23+
24+
//--- Client.swift
25+
import A
26+
27+
@MainActor
28+
func test(t: Test, fn: @escaping @Sendable @MainActor () -> Void) {
29+
t.test(fn) // Ok
30+
}

0 commit comments

Comments
 (0)