From 894008997c927f8ea64e7d1ee45c1cc4804e0de0 Mon Sep 17 00:00:00 2001 From: Eric Bariaux <375613+ebariaux@users.noreply.github.com> Date: Thu, 25 Sep 2025 12:41:14 +0200 Subject: [PATCH] Ensure compatibility with Swift versions below 6 --- Sources/ComplexModule/Complex+Codable.swift | 4 ++++ Sources/ComplexModule/Complex+StringConvertible.swift | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Sources/ComplexModule/Complex+Codable.swift b/Sources/ComplexModule/Complex+Codable.swift index 8d86d36..c233cb7 100644 --- a/Sources/ComplexModule/Complex+Codable.swift +++ b/Sources/ComplexModule/Complex+Codable.swift @@ -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() diff --git a/Sources/ComplexModule/Complex+StringConvertible.swift b/Sources/ComplexModule/Complex+StringConvertible.swift index 778bc49..1c88b5b 100644 --- a/Sources/ComplexModule/Complex+StringConvertible.swift +++ b/Sources/ComplexModule/Complex+StringConvertible.swift @@ -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)))"