Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/Sema/TypeCheckConcurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6195,7 +6195,11 @@ bool swift::checkSendableConformance(
return false;

// If this is an always-unavailable conformance, there's nothing to check.
if (auto ext = dyn_cast<ExtensionDecl>(conformanceDC)) {
// We always use the root conformance for this check, because inherited
// conformances need to walk back to the original declaration for the
// superclass conformance to find an unavailable attribute.
if (auto ext = dyn_cast<ExtensionDecl>(
conformance->getRootConformance()->getDeclContext())) {
if (AvailableAttr::isUnavailable(ext))
return false;
}
Expand Down
8 changes: 8 additions & 0 deletions test/Concurrency/concurrent_value_checking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,14 @@ final class C7<T>: Sendable { }

class C9: Sendable { } // expected-warning{{non-final class 'C9' cannot conform to 'Sendable'; use '@unchecked Sendable'}}

@available(*, unavailable)
extension HasUnavailableSendable : @unchecked Sendable { }

class HasUnavailableSendable {
}

class NoRestated: HasUnavailableSendable {} // okay

@globalActor
struct SomeActor {
static let shared = A1()
Expand Down