Telegraph icon indicating copy to clipboard operation
Telegraph copied to clipboard

Protocol 'WebSocket' as a type cannot conform to 'Equatable'

Open mourgias opened this issue 3 years ago • 1 comments

mourgias avatar Feb 23 '22 08:02 mourgias

You are likely trying to put a WebSocket in a Dictionary. Unfortunately that isn't possible and that will result in the compiler error that you mentioned in the title. At some point I might refactor WebSocket to make that easier, but until then I recommend wrapping the WebSocket in a struct or class. You can give that object a unique identifier and make it support Equatable / Hashable

yvbeek avatar Aug 13 '22 04:08 yvbeek