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 @@ -5072,7 +5072,11 @@ ActorIsolation ActorIsolationRequest::evaluate(
50725072 // isolated to a global actor.
50735073 auto checkGlobalIsolation = [var = dyn_cast<VarDecl>(value)](
50745074 ActorIsolation isolation) {
5075- if (var && var->getLoc () &&
5075+ // Diagnose only declarations in the same module.
5076+ //
5077+ // TODO: This should be factored out from ActorIsolationRequest into
5078+ // either ActorIsolationChecker or DeclChecker.
5079+ if (var && var->getLoc (/* SerializedOK*/ false ) &&
50765080 var->getASTContext ().LangOpts .hasFeature (Feature::GlobalConcurrency) &&
50775081 !isolation.isGlobalActor () &&
50785082 (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