Files
swift-mirror/test/Concurrency/Inputs/SendableConformances.swift
Holly Borla b1397703a5 [ConformanceLookup] Just kidding, the compiler needs to prefer available
Sendable conformances for source compatibility.

If conformance lookup always prefers the conformance from the defining module,
libraries introducing unavailable Sendable conformances can break source in
clients that declare retroactive Sendable conformances. Instead, still prefer
the available conformance, and always diagnose the client conformance as
redundant (as a warning). Then, when the retroactive conformance is removed,
the errors will surface, so the programmer has to take explicit action to
experience the source break.
2024-07-11 23:03:33 -07:00

10 lines
206 B
Swift

public class NonSendableClass {}
@available(*, unavailable)
extension NonSendableClass: @unchecked Sendable {}
public struct SendableStruct: Sendable {}
public struct AnotherSendableStruct: Sendable {}