Update:
I met this problem because I use the hashValue for get Enum count as Antonio's suggestion in this question.
And also, Antonio's answer works well before Xcode 10, I just want to know why the result is changed now.
Original question
Environment: macOS 10.14.1
The same enum, the Xcode 10.1 return the enum item's hashValue as 4607296766572878277, the Xcode 9.4.1 returns 0:
Code:
enum IntEnum: Int {
case first = 1, second
}
let x = IntEnum.first.hashValue
print("first hashValue \(x)")
enum strEnum: String {
case first, second
}
let a = strEnum.first.hashValue
Is this Apple's bug?