Skip to content

Commit e9f1bcc

Browse files
committed
Foundation: add commented out custom AnyHashable representation to Measurement
It is disabled because bridging of Measurement instances does not actually work now.
1 parent 34f6eb1 commit e9f1bcc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

stdlib/public/SDK/Foundation/Measurement.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,18 @@ extension Measurement : _ObjectiveCBridgeable {
288288
}
289289
}
290290

291+
/*
292+
FIXME(id-as-any): can't write this code because of:
293+
<rdar://problem/27539951> "unhandled generic bridged type" when bridging NSMeasurement
294+
295+
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
296+
extension NSMeasurement : _HasCustomAnyHashableRepresentation {
297+
public func _toCustomAnyHashable() -> AnyHashable? {
298+
return AnyHashable(self as Measurement)
299+
}
300+
}
301+
*/
302+
291303
// This workaround is required for the time being, because Swift doesn't support covariance for Measurement (26607639)
292304
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
293305
extension MeasurementFormatter {

0 commit comments

Comments
 (0)