This might be a stupid question, but was this a deliberate decision made by the language designers? If so, why?
-
-
-
I think it has to do with the fact that the enum doesn’t have a raw value type (like Int) and/or the fact that some of its values have associated values. It would be possible to generate a sensible equality operator automatically, but Swift doesn’t.
-
Ah. The compiler notes that “binary operator '==' cannot be synthesized for enums with associated values”. That’s unfortunate, and seems silly in this case, but so it goes.
End of conversation
New conversation -
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.