Skip to content

Commit 63d0b73

Browse files
authored
Merge pull request #36669 from lorentey/fix-float16-sendable
[stdlib] Float16/Intel: Add an explicit Sendable conformance to work around a swiftinterface issue
2 parents ce135e6 + cb67f45 commit 63d0b73

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,9 @@ extension ${Self} {
10191019
}
10201020
}
10211021

1022+
${Availability(bits)}
1023+
extension ${Self}: Sendable { }
1024+
10221025
//===----------------------------------------------------------------------===//
10231026
// Explicit conversions between types.
10241027
//===----------------------------------------------------------------------===//
@@ -1343,9 +1346,6 @@ internal struct _${Self}AnyHashableBox: _AnyHashableBox {
13431346
}
13441347
% end
13451348

1346-
${Availability(bits)}
1347-
extension ${Self} : Sendable { }
1348-
13491349
//===----------------------------------------------------------------------===//
13501350
// Deprecated operators
13511351
//===----------------------------------------------------------------------===//
@@ -1370,6 +1370,17 @@ public struct ${Self} {
13701370
}
13711371
}
13721372

1373+
% if bits == 16:
1374+
// This is a workaround for a compiler bug that omits the macOS 11 availability
1375+
// from the implicit conformance emitted into the generated .swiftinterface
1376+
// file. See https://github.com/apple/swift/pull/36669 for details.
1377+
// FIXME: rdar://76092800
1378+
@available(macOS 11, iOS 14, tvOS 14, watchOS 7, *)
1379+
@available(macOS, unavailable)
1380+
@available(macCatalyst, unavailable)
1381+
extension ${Self}: Sendable { }
1382+
% end
1383+
13731384
#endif
13741385
% end
13751386
% end # for bits in all_floating_point_types

0 commit comments

Comments
 (0)