Pragma to disable CGPoint fallback for Hashtable protocol Xcode error

I have Swift code for the CGPoint extension:

 extension CGPoint: Hashable { public var hashValue:Int { return self.x.hashValue ^ self.y.hashValue } } 

The very first line causes an error in Xcode, redundant "CGPoint" for the "Hashable" protocol:

Xcode screenshot with error message

But this is not redundant. The following line of code, later in my Swift file, relies on it:

 private var borderPoints:Set<CGPoint>? 

At its core, the code builds and works fine, that is, I can ignore the Xcode error message. If I listen to the error message and remove the protocol compatibility (which Xcode says is redundant), my code cannot be built and Xcode will throw an error. Type "CGPoint" does not comply with the "Hashable" protocol:

Xcode screenshot with second error

Since my code is not being generated right now, this is a bug that I have to fix, i.e. I need to enable protocol compliance that Xcode complained about earlier.

Swift is a new language, so I don't mind too much if it's just a mistake in understanding Xcode extensions and protocol compliance, but I would like to disable the error message. I know how to disable them for the whole project , but what is the Swift code pragma to disable this error message only for this line?

+7
xcode swift2
source share

No one has answered this question yet.

See similar questions:

one
Xcode: How to disable compiler error messages in the source window?

or similar:

nine
Xcode generated probe header for framework does not import Foundation when @objc output is disabled
6
Multiple protocol inheritance in Swift 2.0 using extension protocols
5
swift2 AVAudioRecorder
3
Protocol Compliance
3
** Fallback compliance "FlickrPhotosViewController" for the protocol "UICollectionViewDataSource" **
2
IOS AWS protocol methods with the Error parameter as the parameter cause the protocol to mismatch
one
CFString not compliant with Hashable protocol?
one
AppDelegate type not conforming to CLLocationManagerDelegate protocol - Swift in Xcode 6
0
Creating a custom table view and receiving the error "Type SecondViewController does not comply with the protocol" UITableviewDataSource "
0
code change from Swift 1 to 2, Error: enter 'NSDirectoryEnumeration Options' does not match the protocol 'NilLiteralConvertible'

All Articles