Skip to content

Commit 698e06c

Browse files
authored
Merge pull request #41076 from DougGregor/concurrency-diag-conformance-context
2 parents 86b4682 + 104cd47 commit 698e06c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2909,7 +2909,7 @@ bool ConformanceChecker::checkActorIsolation(
29092909
bool isCrossActor = false;
29102910
bool witnessIsUnsafe = false;
29112911
DiagnosticBehavior behavior = SendableCheckContext(
2912-
witness->getInnermostDeclContext()).defaultDiagnosticBehavior();
2912+
Conformance->getDeclContext()).defaultDiagnosticBehavior();
29132913
Type witnessGlobalActor;
29142914
switch (auto witnessRestriction =
29152915
ActorIsolationRestriction::forDeclaration(

test/Concurrency/actor_isolation_unsafe.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ struct S3_P1: P1 {
2929
nonisolated func onMainActor() { }
3030
}
3131

32+
struct S4_P1_quitely: P1 {
33+
@SomeGlobalActor func onMainActor() { }
34+
}
35+
36+
@SomeGlobalActor
3237
struct S4_P1: P1 {
3338
@SomeGlobalActor func onMainActor() { } // expected-warning{{instance method 'onMainActor()' isolated to global actor 'SomeGlobalActor' can not satisfy corresponding requirement from protocol 'P1' isolated to global actor 'MainActor'}}
3439
}
3540

41+
3642
@MainActor(unsafe)
3743
protocol P2 {
3844
func f() // expected-note{{calls to instance method 'f()' from outside of its actor context are implicitly asynchronous}}

test/decl/class/actor/global_actor_conformance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -disable-availability-checking
1+
// RUN: %target-typecheck-verify-swift -disable-availability-checking -warn-concurrency
22
// REQUIRES: concurrency
33

44
actor SomeActor { }

0 commit comments

Comments
 (0)