Skip to content

Commit b604635

Browse files
committed
🤮
1 parent 70b68d6 commit b604635

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

stdlib/public/core/FloatingPoint.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,11 +1890,15 @@ extension BinaryFloatingPoint {
18901890
/// - Parameter value: A floating-point value to be converted.
18911891
@inlinable
18921892
public init<Source: BinaryFloatingPoint>(_ value: Source) {
1893-
switch value {
18941893
#if !os(macOS) && !(os(iOS) && targetEnvironment(macCatalyst))
1895-
case let value_ as Float16:
1896-
self = Self(Float(value_))
1894+
if #available(iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
1895+
if case let value_ as Float16 = value {
1896+
self = Self(Float(value_))
1897+
return
1898+
}
1899+
}
18971900
#endif
1901+
switch value {
18981902
case let value_ as Float:
18991903
self = Self(value_)
19001904
case let value_ as Double:

0 commit comments

Comments
 (0)