You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Perform this cast in a separate function unaware of the T: Hashable constraint to avoid compiler warnings when performing the Hashable --> Hashable & Sendable cast
40
+
value as!RawValue
41
+
}
42
+
43
+
fileprivateinit<K:AttributedStringKey>(assumingSendable value:K.Value, for key:K.Type){
/// Stores & retrieves an attribute value bypassing the T.Value : Sendable constraint
226
+
///
227
+
/// In general, callers should _always_ use the subscript that contains a T.Value : Sendable constraint
228
+
/// This subscript should only be used in contexts when callers are forced to work around the lack of an AttributedStringKey.Value : Sendable constraint and assume the values are Sendable (ex. during NSAttributedString conversion while iterating scopes)
tryK.encode(attributes[K.self]!, to: attributeEncoder)
231
+
// We must assume that the value is Sendable here because we are dynamically iterating a scope and the attribute keys do not statically declare the values are Sendable
232
+
tryK.encode(attributes[assumingSendable:K.self]!, to: attributeEncoder)
232
233
}
233
234
tryproject(encodableAttributeType)
234
235
} // else: the attribute was not in the provided scope or was not encodable, so drop it
// We must assume that the value is Sendable here because we are dynamically iterating a scope and the attribute keys do not statically declare the values are Sendable
// We must assume that the value is Sendable here because we are dynamically iterating a scope and the attribute keys do not statically declare the values are Sendable
// We must assume that the value is Sendable here because we are dynamically iterating a scope and the attribute keys do not statically declare the values are Sendable
0 commit comments