Skip to content

Commit 70b68d6

Browse files
committed
[stdlib] Include Float16 among source types recognized for generic conversion
1 parent 42f79b0 commit 70b68d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/core/FloatingPoint.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,10 @@ extension BinaryFloatingPoint {
18911891
@inlinable
18921892
public init<Source: BinaryFloatingPoint>(_ value: Source) {
18931893
switch value {
1894+
#if !os(macOS) && !(os(iOS) && targetEnvironment(macCatalyst))
1895+
case let value_ as Float16:
1896+
self = Self(Float(value_))
1897+
#endif
18941898
case let value_ as Float:
18951899
self = Self(value_)
18961900
case let value_ as Double:

0 commit comments

Comments
 (0)