Avatar
@swift-6.2.3 -swift-version 6 struct MyDictionary<K, V> {} extension MyDictionary: Sendable where K: Sendable {} typealias StringDictionary<Key: Sendable> = MyDictionary<Key, String> extension StringDictionary: Error {} func useIt(_ dict: Any) { if let _ = dict as? any Error { print("treat dict as Sendable") } else { print("treat dict as Non-Sendable") } } class C {} let nonSendableDict = MyDictionary<C, String>() useIt(nonSendableDict)