core-data icon indicating copy to clipboard operation
core-data copied to clipboard

Utilities.swift Binary Operator Error

Open rouviere opened this issue 7 years ago • 2 comments

When attempting to run Sample Project Chapter 1.1 and 1.2 I get the following error on the Utilities.swift file:

Binary operator '===' cannot be applied to operands of type 'Self.Element' and 'AnyObject'

There is also a warning on ColorSpaceConversion.swift:

Initializer for struct 'ARGBPixel_s' must use "self.init(...)" or "self = ..." because the struct was imported from C

rouviere avatar Jun 20 '18 21:06 rouviere

Have a look at my comment on #48

Hope this helps

tkrajacic avatar Jun 22 '18 05:06 tkrajacic

As @tkrajacic says you need to change the extension to:

extension Sequence where Element: AnyObject

The type system only checks the Sequence's Element type so it can't establish that every element of the Sequence is also an AnyObject, so changing the extension the type system is not gonna have this problem.

Please check that and if the problem is solved check this issue as complete.

EfrenPerez94 avatar Jul 06 '18 06:07 EfrenPerez94