File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -1670,8 +1670,12 @@ namespace {
1670
1670
}
1671
1671
1672
1672
auto layout = type.getExistentialLayout ();
1673
-
1674
- auto protocols = layout.getProtocols ();
1673
+
1674
+ SmallVector<ProtocolType *, 4 > protocols;
1675
+ for (auto proto : layout.getProtocols ()) {
1676
+ if (!proto->getDecl ()->isMarkerProtocol ())
1677
+ protocols.push_back (proto);
1678
+ }
1675
1679
1676
1680
// Collect references to the protocol descriptors.
1677
1681
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
+ // Temporarily disable on arm (rdar://89910199)
13
+ // UNSUPPORTED: CPU=arm64, CPU=arm64e
14
+
15
+ @_marker public protocol P { }
16
+ public protocol Q : P { }
17
+ protocol R { }
18
+
19
+
20
+ // Suppress marker protocols when forming existentials at runtime
21
+ public func takeAnyType< T> ( _: T . Type ) { }
22
+
23
+ // CHECK-LABEL: define {{.*}}@"$ss8Sendable_26marker_protocol_backdeploy1QAB1RpMa"
24
+ // CHECK: ss8Sendable_26marker_protocol_backdeploy1QAB1RpML
25
+ // CHECK-NOT: Sendable
26
+ // CHECK: s26marker_protocol_backdeploy1QMp
27
+ // CHECK-NOT: Sendable
28
+ // CHECK: s26marker_protocol_backdeploy1RMp
29
+ // CHECK-NOT: SENDABLE
30
+ // CHECK: swift_getExistentialTypeMetadata
31
+ public func passExistentialType( ) {
32
+ typealias Fn = ( Sendable & P & Q & R ) async -> Void
33
+ takeAnyType ( Fn . self)
34
+ }
You can’t perform that action at this time.
0 commit comments