We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 06637ae + 65ac75f commit 82e5d7fCopy full SHA for 82e5d7f
lib/AST/Decl.cpp
@@ -10719,6 +10719,9 @@ AccessorDecl *AccessorDecl::createParsed(
10719
// The cloned parameter is implicit.
10720
param->setImplicit();
10721
10722
+ if (subscriptParam->isSending())
10723
+ param->setSending();
10724
+
10725
newParams.push_back(param);
10726
}
10727
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