File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -6219,7 +6219,11 @@ bool swift::checkSendableConformance(
6219
6219
return false ;
6220
6220
6221
6221
// If this is an always-unavailable conformance, there's nothing to check.
6222
- if (auto ext = dyn_cast<ExtensionDecl>(conformanceDC)) {
6222
+ // We always use the root conformance for this check, because inherited
6223
+ // conformances need to walk back to the original declaration for the
6224
+ // superclass conformance to find an unavailable attribute.
6225
+ if (auto ext = dyn_cast<ExtensionDecl>(
6226
+ conformance->getRootConformance ()->getDeclContext ())) {
6223
6227
if (AvailableAttr::isUnavailable (ext))
6224
6228
return false ;
6225
6229
}
Original file line number Diff line number Diff line change @@ -381,6 +381,14 @@ final class C7<T>: Sendable { }
381
381
382
382
class C9 : Sendable { } // expected-warning{{non-final class 'C9' cannot conform to 'Sendable'; use '@unchecked Sendable'}}
383
383
384
+ @available ( * , unavailable)
385
+ extension HasUnavailableSendable : @unchecked Sendable { }
386
+
387
+ class HasUnavailableSendable {
388
+ }
389
+
390
+ class NoRestated : HasUnavailableSendable { } // okay
391
+
384
392
@globalActor
385
393
struct SomeActor {
386
394
static let shared = A1 ( )
You can’t perform that action at this time.
0 commit comments