File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Sources/SwiftCompilerPluginMessageHandling/JSON Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ func encodeToJSON(value: some Encodable) throws -> [UInt8] {
1717}
1818
1919/// Intermediate representation for serializing JSON structure.
20- private class JSONReference {
20+ private final class JSONReference {
2121 enum Backing {
2222 case null
2323 case trueKeyword
@@ -60,9 +60,17 @@ private class JSONReference {
6060 backing = . array( arr)
6161 }
6262
63+ #if swift(>=6)
64+ // nonisolated(unsafe) is fine for these properties because they represent primitives
65+ // that are never modified.
66+ nonisolated ( unsafe) static let null : JSONReference = . init( backing: . null)
67+ nonisolated ( unsafe) static let trueKeyword : JSONReference = . init( backing: . trueKeyword)
68+ nonisolated ( unsafe) static let falseKeyword : JSONReference = . init( backing: . falseKeyword)
69+ #else
6370 static let null : JSONReference = . init( backing: . null)
6471 static let trueKeyword : JSONReference = . init( backing: . trueKeyword)
6572 static let falseKeyword : JSONReference = . init( backing: . falseKeyword)
73+ #endif
6674
6775 @inline ( __always)
6876 static func newArray( ) -> JSONReference {
You can’t perform that action at this time.
0 commit comments