We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ec8a12 commit 65ac75fCopy full SHA for 65ac75f
lib/AST/Decl.cpp
@@ -10607,6 +10607,9 @@ AccessorDecl *AccessorDecl::createParsed(
10607
// The cloned parameter is implicit.
10608
param->setImplicit();
10609
10610
+ if (subscriptParam->isSending())
10611
+ param->setSending();
10612
+
10613
newParams.push_back(param);
10614
}
10615
test/Concurrency/sending_witness_subscript.swift
@@ -0,0 +1,11 @@
1
+// RUN: %target-swift-frontend -emit-sil -swift-version 6 %s -o /dev/null -verify
2
3
+class NonSendableKlass {}
4
5
+protocol P {
6
+ subscript(_: sending NonSendableKlass) -> sending NonSendableKlass { get }
7
+}
8
9
+struct S: P {
10
+ subscript(_: sending NonSendableKlass) -> sending NonSendableKlass { NonSendableKlass() }
11
0 commit comments