File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -1681,8 +1681,12 @@ namespace {
16811681 }
16821682
16831683 auto layout = type.getExistentialLayout ();
1684-
1685- auto protocols = layout.getProtocols ();
1684+
1685+ SmallVector<ProtocolType *, 4 > protocols;
1686+ for (auto proto : layout.getProtocols ()) {
1687+ if (!proto->getDecl ()->isMarkerProtocol ())
1688+ protocols.push_back (proto);
1689+ }
16861690
16871691 // Collect references to the protocol descriptors.
16881692 auto descriptorArrayTy
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -primary-file %s -target %target-cpu-apple-macosx10.15 -emit-ir -o - | %FileCheck %s
2+
3+ // Marker protocols should have no ABI impact at all, so this source file checks
4+ // for the absence of symbols related to marker protocols.
5+
6+ // CHECK-NOT: $s26marker_protocol_backdeploy1PP
7+ // CHECK-NOT: $s26marker_protocol_backdeploy1PMp
8+
9+ // REQUIRES: PTRSIZE=64
10+ // REQUIRES: OS=macosx
11+
12+ @_marker public protocol P { }
13+ public protocol Q : P { }
14+ protocol R { }
15+
16+
17+ // Suppress marker protocols when forming existentials at runtime
18+ public func takeAnyType< T> ( _: T . Type ) { }
19+
20+ // CHECK-LABEL: define {{.*}}@"$ss8Sendable_26marker_protocol_backdeploy1QAB1RpMa"
21+ // CHECK: ss8Sendable_26marker_protocol_backdeploy1QAB1RpML
22+ // CHECK-NOT: Sendable
23+ // CHECK: s26marker_protocol_backdeploy1QMp
24+ // CHECK-NOT: Sendable
25+ // CHECK: s26marker_protocol_backdeploy1RMp
26+ // CHECK-NOT: SENDABLE
27+ // CHECK: swift_getExistentialTypeMetadata
28+ public func passExistentialType( ) {
29+ typealias Fn = ( Sendable & P & Q & R ) async -> Void
30+ takeAnyType ( Fn . self)
31+ }
You can’t perform that action at this time.
0 commit comments