Skip to content

Commit 8940089

Browse files
committed
Ensure compatibility with Swift versions below 6
1 parent d46e20b commit 8940089

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/ComplexModule/Complex+Codable.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
import RealModule
1313

1414
// FloatingPoint does not refine Codable, so this is a conditional conformance.
15+
#if compiler(>=6.0)
1516
@_unavailableInEmbedded
17+
#endif
1618
extension Complex: Decodable where RealType: Decodable {
1719
public init(from decoder: Decoder) throws {
1820
var unkeyedContainer = try decoder.unkeyedContainer()
@@ -22,7 +24,9 @@ extension Complex: Decodable where RealType: Decodable {
2224
}
2325
}
2426

27+
#if compiler(>=6.0)
2528
@_unavailableInEmbedded
29+
#endif
2630
extension Complex: Encodable where RealType: Encodable {
2731
public func encode(to encoder: Encoder) throws {
2832
var unkeyedContainer = encoder.unkeyedContainer()

Sources/ComplexModule/Complex+StringConvertible.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ extension Complex: CustomStringConvertible {
1616
}
1717
}
1818

19+
#if compiler(>=6.0)
1920
@_unavailableInEmbedded
21+
#endif
2022
extension Complex: CustomDebugStringConvertible {
2123
public var debugDescription: String {
2224
"Complex<\(RealType.self)>(\(String(reflecting: x)), \(String(reflecting: y)))"

0 commit comments

Comments
 (0)