Skip to content

Commit 6fe203d

Browse files
committed
[sendable] MetadataValue conformance must be unchecked on 5.6 now
1 parent 6b0ccb1 commit 6fe203d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/Logging/Logging.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,9 +1276,14 @@ extension Logger.MetadataValue: ExpressibleByArrayLiteral {
12761276

12771277
// MARK: - Sendable support helpers
12781278

1279+
#if compiler(>=5.7.0)
1280+
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 (!)
1281+
#elseif compiler(>=5.6)
1282+
extension Logger.MetadataValue: @unchecked Sendable {} // sadly, On 5.6 a missing Sendable conformance causes an 'error' (specifically this is about `stringConvertible`'s value)
1283+
#endif
1284+
12791285
#if compiler(>=5.6)
12801286
extension Logger: Sendable {}
1281-
extension Logger.MetadataValue: Sendable {}
12821287
extension Logger.Level: Sendable {}
12831288
extension Logger.Message: Sendable {}
12841289
#endif

0 commit comments

Comments
 (0)