Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binary operator '==' cannot be applied to two 'Equatable' operands... what?

You can see in the image below that I was trying to extend the Collection protocol to include a method called removingDuplicates, which is supposed to do exactly what it says. The error that the compiler is displaying seems to directly contradict the definition of the Equatable protocol. Is this a bug or am I misunderstanding something?

enter image description here

like image 455
jeremyabannister Avatar asked Oct 26 '25 18:10

jeremyabannister


1 Answers

Replace Element == Equatable with Element: Equatable.

like image 83
Ole Begemann Avatar answered Oct 29 '25 07:10

Ole Begemann