File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -4642,10 +4642,12 @@ void ConformanceChecker::resolveValueWitnesses() {
4642
4642
return ;
4643
4643
4644
4644
// Ensure that Actor.unownedExecutor is implemented within the
4645
- // actor class itself.
4645
+ // actor class itself. But if this somehow resolves to the
4646
+ // requirement, ignore it.
4646
4647
if (requirement->getName ().isSimpleName (C.Id_unownedExecutor ) &&
4647
4648
Proto->isSpecificProtocol (KnownProtocolKind::Actor) &&
4648
4649
DC != witness->getDeclContext () &&
4650
+ !isa<ProtocolDecl>(witness->getDeclContext ()) &&
4649
4651
Adoptee->getClassOrBoundGenericClass () &&
4650
4652
Adoptee->getClassOrBoundGenericClass ()->isActor ()) {
4651
4653
witness->diagnose (diag::unowned_executor_outside_actor);
Original file line number Diff line number Diff line change
1
+ // swift-interface-format-version: 1.0
2
+ // swift-module-flags: -enable-library-evolution -module-name OldActor -enable-experimental-concurrency
3
+ import Swift
4
+ import _Concurrency
5
+
6
+ #if compiler(>=5.3) && $Actors
7
+ @available(SwiftStdlib 5.5, *)
8
+ public actor Monk {
9
+ public init()
10
+ deinit
11
+ public func method()
12
+ // Lacks an unownedExecutor property
13
+ }
14
+ #endif
15
+
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: mkdir -p %t/OldActor.framework/Modules/OldActor.swiftmodule
3
+ // RUN: %target-swift-frontend -emit-module -module-name OldActor %S/Inputs/OldActor.swiftinterface -o %t/OldActor.framework/Modules/OldActor.swiftmodule/%module-target-triple.swiftmodule
4
+ // RUN: %target-swift-frontend -F %t -enable-experimental-concurrency -typecheck -verify %s
5
+
6
+ // RUNX: cp -r %S/Inputs/OldActor.framework %t/
7
+ // RUNX: %{python} %S/../CrossImport/Inputs/rewrite-module-triples.py %t %module-target-triple
8
+
9
+ // REQUIRES: concurrency
10
+
11
+ import OldActor
12
+
13
+ @available ( SwiftStdlib 5 . 5 , * )
14
+ extension Monk {
15
+ public func test( ) async {
16
+ method ( )
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments