File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -5131,7 +5131,11 @@ ActorIsolation ActorIsolationRequest::evaluate(
5131
5131
// isolated to a global actor.
5132
5132
auto checkGlobalIsolation = [var = dyn_cast<VarDecl>(value)](
5133
5133
ActorIsolation isolation) {
5134
- if (var && var->getLoc () &&
5134
+ // Diagnose only declarations in the same module.
5135
+ //
5136
+ // TODO: This should be factored out from ActorIsolationRequest into
5137
+ // either ActorIsolationChecker or DeclChecker.
5138
+ if (var && var->getLoc (/* SerializedOK*/ false ) &&
5135
5139
var->getASTContext ().LangOpts .hasFeature (Feature::GlobalConcurrency) &&
5136
5140
!isolation.isGlobalActor () &&
5137
5141
(isolation != ActorIsolation::NonisolatedUnsafe)) {
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %empty-directory(%t/src)
3
+ // RUN: %empty-directory(%t/lib)
4
+ // RUN: split-file %s %t/src
5
+
6
+ /// Build the library
7
+ // RUN: %target-swift-frontend -emit-module %t/src/Lib.swift \
8
+ // RUN: -module-name Lib -swift-version 5 \
9
+ // RUN: -enable-library-evolution \
10
+ // RUN: -emit-module-interface-path %t/lib/Lib.swiftinterface \
11
+ // RUN: -emit-module-path %t/lib/Lib.swiftmodule \
12
+ // RUN: -emit-module-source-info-path %t/lib/Lib.swiftsourceinfo
13
+
14
+ // Build the client
15
+ // RUN: %target-swift-frontend -typecheck -primary-file %t/src/Client.swift \
16
+ // RUN: -module-name Client -I %t/lib \
17
+ // RUN: -swift-version 6
18
+
19
+ // REQUIRES: asserts
20
+ // REQUIRES: concurrency
21
+
22
+ //--- Lib.swift
23
+
24
+ public struct Test : Equatable {
25
+ public static let value = Test ( x: 0 )
26
+
27
+ public var x : UInt64
28
+
29
+ private init ( x: UInt64 ) {
30
+ self . x = x
31
+ }
32
+ }
33
+
34
+ //--- Client.swift
35
+ import Lib
36
+
37
+ public func test( ) -> Test {
38
+ . value // Ok (no sendability errors)
39
+ }
You can’t perform that action at this time.
0 commit comments