Skip to content

Commit 683431a

Browse files
Revert "(113200224) JSON/PropertyList coders userInfo should require Sendable…" (#1167)
This reverts commit c5bacdf. Co-authored-by: Stuart Montgomery <[email protected]>
1 parent c5bacdf commit 683431a

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

Sources/FoundationEssentials/JSON/JSONDecoder.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ open class JSONDecoder {
257257
}
258258

259259
/// Contextual user-provided information for use during decoding.
260-
@preconcurrency
261-
open var userInfo: [CodingUserInfoKey : any Sendable] {
260+
open var userInfo: [CodingUserInfoKey : Any] {
262261
get {
263262
optionsLock.lock()
264263
defer { optionsLock.unlock() }
@@ -310,7 +309,7 @@ open class JSONDecoder {
310309
var dataDecodingStrategy: DataDecodingStrategy = .base64
311310
var nonConformingFloatDecodingStrategy: NonConformingFloatDecodingStrategy = .throw
312311
var keyDecodingStrategy: KeyDecodingStrategy = .useDefaultKeys
313-
var userInfo: [CodingUserInfoKey : any Sendable] = [:]
312+
var userInfo: [CodingUserInfoKey : Any] = [:]
314313
var json5: Bool = false
315314
}
316315

Sources/FoundationEssentials/JSON/JSONEncoder.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ open class JSONEncoder {
295295
}
296296

297297
/// Contextual user-provided information for use during encoding.
298-
@preconcurrency
299-
open var userInfo: [CodingUserInfoKey : any Sendable] {
298+
open var userInfo: [CodingUserInfoKey : Any] {
300299
get {
301300
optionsLock.lock()
302301
defer { optionsLock.unlock() }
@@ -325,7 +324,7 @@ open class JSONEncoder {
325324
var dataEncodingStrategy: DataEncodingStrategy = .base64
326325
var nonConformingFloatEncodingStrategy: NonConformingFloatEncodingStrategy = .throw
327326
var keyEncodingStrategy: KeyEncodingStrategy = .useDefaultKeys
328-
var userInfo: [CodingUserInfoKey : any Sendable] = [:]
327+
var userInfo: [CodingUserInfoKey : Any] = [:]
329328
}
330329

331330
/// The options set on the top-level encoder.

Sources/FoundationEssentials/PropertyList/PlistDecoder.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ open class PropertyListDecoder {
3838
// MARK: Options
3939

4040
/// Contextual user-provided information for use during decoding.
41-
@preconcurrency
42-
open var userInfo: [CodingUserInfoKey : any Sendable] {
41+
open var userInfo: [CodingUserInfoKey : Any] {
4342
get {
4443
optionsLock.lock()
4544
defer { optionsLock.unlock() }
@@ -63,7 +62,7 @@ open class PropertyListDecoder {
6362

6463
/// Options set on the top-level encoder to pass down the decoding hierarchy.
6564
internal struct _Options {
66-
var userInfo: [CodingUserInfoKey : any Sendable] = [:]
65+
var userInfo: [CodingUserInfoKey : Any] = [:]
6766
}
6867

6968
/// The options set on the top-level decoder.

Sources/FoundationEssentials/PropertyList/PlistEncoder.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ open class PropertyListEncoder {
5151
}
5252

5353
/// Contextual user-provided information for use during encoding.
54-
@preconcurrency
55-
open var userInfo: [CodingUserInfoKey : any Sendable] {
54+
open var userInfo: [CodingUserInfoKey : Any] {
5655
get {
5756
optionsLock.lock()
5857
defer { optionsLock.unlock() }
@@ -77,7 +76,7 @@ open class PropertyListEncoder {
7776
/// Options set on the top-level encoder to pass down the encoding hierarchy.
7877
internal struct _Options {
7978
var outputFormat: PropertyListDecoder.PropertyListFormat = .binary
80-
var userInfo: [CodingUserInfoKey : any Sendable] = [:]
79+
var userInfo: [CodingUserInfoKey : Any] = [:]
8180
}
8281

8382
/// The options set on the top-level encoder.

0 commit comments

Comments
 (0)