swift icon indicating copy to clipboard operation
swift copied to clipboard

[ConformanceLookup] Don't allow skipping inherited unavailable conformances in favor of explicit available ones.

Open hborla opened this issue 1 year ago • 0 comments

The type checker does not support the notion of multiple protocol conformances; there can only be one conformance, and if that conformance is unavailable, you cannot specify your own available conformance. This is important for Sendable checking; if a framework specifies that a type is explicitly not Sendable with an unavailable Sendable conformance, clients cannot ignore Sendable violations involving that type. If a superclass wants to allow subclasses to add a Sendable conformance, it should not declare an unavailable Sendable conformance.

I still need to fix this to warn on the redundant conformance, while allowing re-stated @unchecked Sendable conformances on subclasses when there's no difference in availability.

Resolves: rdar://124423524

hborla avatar Jul 10 '24 19:07 hborla