Skip to content

[stdlib] Float16/Intel: Add an explicit Sendable conformance to work around a swiftinterface issue #36669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2021
Merged
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
17 changes: 14 additions & 3 deletions stdlib/public/core/FloatingPointTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,9 @@ extension ${Self} {
}
}

${Availability(bits)}
extension ${Self}: Sendable { }

//===----------------------------------------------------------------------===//
// Explicit conversions between types.
//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -1343,9 +1346,6 @@ internal struct _${Self}AnyHashableBox: _AnyHashableBox {
}
% end

${Availability(bits)}
extension ${Self} : Sendable { }

//===----------------------------------------------------------------------===//
// Deprecated operators
//===----------------------------------------------------------------------===//
Expand All @@ -1370,6 +1370,17 @@ public struct ${Self} {
}
}

% if bits == 16:
// This is a workaround for a compiler bug that omits the macOS 11 availability
// from the implicit conformance emitted into the generated .swiftinterface
// file. See https://github.com/apple/swift/pull/36669 for details.
// FIXME: rdar://76092800
@available(macOS 11, iOS 14, tvOS 14, watchOS 7, *)
@available(macOS, unavailable)
@available(macCatalyst, unavailable)
extension ${Self}: Sendable { }
% end

#endif
% end
% end # for bits in all_floating_point_types
Expand Down