mirror of
https://github.com/apple/swift-numerics
synced 2026-11-22 04:30:45 +00:00
Ensure compatibility with Swift versions below 6
This commit is contained in:
1 parent
d46e20b4c5
commit
894008997c
2 files changed
+6
No files matched your search
@@ -12,7 +12,9 @@
|
||||
import RealModule
|
||||
|
||||
// FloatingPoint does not refine Codable, so this is a conditional conformance.
|
||||
#if compiler(>=6.0)
|
||||
@_unavailableInEmbedded
|
||||
#endif
|
||||
extension Complex: Decodable where RealType: Decodable {
|
||||
public init(from decoder: Decoder) throws {
|
||||
var unkeyedContainer = try decoder.unkeyedContainer()
|
||||
@@ -22,7 +24,9 @@ extension Complex: Decodable where RealType: Decodable {
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6.0)
|
||||
@_unavailableInEmbedded
|
||||
#endif
|
||||
extension Complex: Encodable where RealType: Encodable {
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var unkeyedContainer = encoder.unkeyedContainer()
|
||||
|
||||
@@ -16,7 +16,9 @@ extension Complex: CustomStringConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6.0)
|
||||
@_unavailableInEmbedded
|
||||
#endif
|
||||
extension Complex: CustomDebugStringConvertible {
|
||||
public var debugDescription: String {
|
||||
"Complex<\(RealType.self)>(\(String(reflecting: x)), \(String(reflecting: y)))"
|
||||
|
||||
Reference in new issue
Block a user