You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Concurrency] Fix SendableMetatype conformance failures to behave like Sendable ones
No warnings with minimal checking, warnings with `strict-concurrency=complete` and
if declaration is `@preconcurrency` until next major swift version.
Resolves: rdar://151911135
Resolves: #81739
(cherry picked from commit e326cd00930ff042ba1595e7793af9aaf0208b97)
func test<T>(t:T.Type){ // expected-complete-tns-note 2 {{consider making generic parameter 'T' conform to the 'SendableMetatype' protocol}} {{14-14=: SendableMetatype}}
367
+
acceptsSendableMetatype(t)
368
+
// expected-complete-tns-warning@-1 {{type 'T' does not conform to the 'SendableMetatype' protocol}}
369
+
acceptsSendableMetatypeStrict(t)
370
+
// expected-complete-tns-warning@-1 {{type 'T' does not conform to the 'SendableMetatype' protocol}}
func testWarning<T>(t:T.Type){ // expected-note 2 {{consider making generic parameter 'T' conform to the 'SendableMetatype' protocol}} {{21-21=: SendableMetatype}}
333
+
acceptsSendableMetatype(t) // expected-warning {{type 'T' does not conform to the 'SendableMetatype' protocol}}
334
+
acceptsSendableMetatypeStrict(t) // expected-error {{type 'T' does not conform to the 'SendableMetatype' protocol}}
335
+
}
336
+
337
+
func testOK<T:P>(t:T.Type){
338
+
acceptsSendableMetatype(t) // Ok (because P is `Sendable`
func testWarning<T>(t:T.Type){ // expected-note {{consider making generic parameter 'T' conform to the 'SendableMetatype' protocol}} {{21-21=: SendableMetatype}}
94
+
acceptsSendableMetatype(t) // expected-warning {{type 'T' does not conform to the 'SendableMetatype' protocol}}
95
+
}
96
+
97
+
func testWarning<T:P>(t:T.Type){ // expected-note {{consider making generic parameter 'T' conform to the 'SendableMetatype' protocol}} {{24-24= & SendableMetatype}}
98
+
acceptsSendableMetatype(t) // expected-warning {{type 'T' does not conform to the 'SendableMetatype' protocol}}
0 commit comments