Skip to content

Commit 1945364

Browse files
committed
[AnyHashable] Work around older compiler limitation.
An older Swift compiler failed to account for the witnesses in a conformance with platform availability having their own availability, which causes that compiler to reject the Swift module's .swiftinterface file when it includes `AnyHashable` 's conformance to `_HasCustomAnyHashableRepresentation`. Work around the issue by making the one witness (`_toCustomAnyHashable`, which is trivial) always-emit-into-client, so it does not need any availability. Fixes rdar://76370138.
1 parent c1cb50f commit 1945364

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/core/AnyHashable.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ extension AnyHashable: CustomReflectable {
262262

263263
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
264264
extension AnyHashable: _HasCustomAnyHashableRepresentation {
265+
}
266+
267+
extension AnyHashable {
268+
@_alwaysEmitIntoClient
265269
public __consuming func _toCustomAnyHashable() -> AnyHashable? {
266270
return self
267271
}

0 commit comments

Comments
 (0)