Skip to content

Commit

Permalink
[sendable] MetadataValue conformance must be unchecked on 5.6 now
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoso committed Aug 15, 2022
1 parent 6b0ccb1 commit 6fe203d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/Logging/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1276,9 +1276,14 @@ extension Logger.MetadataValue: ExpressibleByArrayLiteral {

// MARK: - Sendable support helpers

#if compiler(>=5.7.0)
extension Logger.MetadataValue: Sendable {} // on 5.7 `stringConvertible`'s value marked as Sendable; but if a value not conforming to Sendable is passed there, a warning is emitted. We are okay with warnings, but on 5.6 for the same situation an error is emitted (!)
#elseif compiler(>=5.6)
extension Logger.MetadataValue: @unchecked Sendable {} // sadly, On 5.6 a missing Sendable conformance causes an 'error' (specifically this is about `stringConvertible`'s value)
#endif

#if compiler(>=5.6)
extension Logger: Sendable {}
extension Logger.MetadataValue: Sendable {}
extension Logger.Level: Sendable {}
extension Logger.Message: Sendable {}
#endif

0 comments on commit 6fe203d

Please sign in to comment.