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() {
46424642 return ;
46434643
46444644 // 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.
46464647 if (requirement->getName ().isSimpleName (C.Id_unownedExecutor ) &&
46474648 Proto->isSpecificProtocol (KnownProtocolKind::Actor) &&
46484649 DC != witness->getDeclContext () &&
4650+ !isa<ProtocolDecl>(witness->getDeclContext ()) &&
46494651 Adoptee->getClassOrBoundGenericClass () &&
46504652 Adoptee->getClassOrBoundGenericClass ()->isActor ()) {
46514653 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