File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7378,6 +7378,12 @@ bool swift::checkSendableConformance(
73787378 // Sendable supression allows conditional conformances only.
73797379 if (nominal->suppressesConformance (KnownProtocolKind::Sendable)) {
73807380 bool hasUnconditionalConformance = false ;
7381+
7382+ if (auto *inherited = dyn_cast<InheritedProtocolConformance>(conformance)) {
7383+ hasUnconditionalConformance =
7384+ inherited->getConditionalRequirements ().empty ();
7385+ }
7386+
73817387 if (auto *normalConf = dyn_cast<NormalProtocolConformance>(conformance)) {
73827388 hasUnconditionalConformance =
73837389 normalConf->getConditionalRequirements ().empty ();
Original file line number Diff line number Diff line change @@ -119,4 +119,16 @@ do {
119119
120120 testSendable ( IsolatedC ( ) )
121121 // expected-warning@-1 {{type 'IsolatedC' does not conform to the 'Sendable' protocol}}
122+
123+ @MainActor
124+ class IsolatedBase { } // derived as Sendable
125+
126+ class Child1 : IsolatedBase , ~ Sendable { }
127+ // expected-error@-1 {{cannot both conform to and suppress conformance to 'Sendable'}}
128+
129+ class Base : Sendable { }
130+ // expected-warning@-1 {{non-final class 'Base' cannot conform to the 'Sendable' protocol}}
131+
132+ class Child2 : Base , ~ Sendable { }
133+ // expected-error@-1 {{cannot both conform to and suppress conformance to 'Sendable'}}
122134}
You can’t perform that action at this time.
0 commit comments