The following code

struct A {}

let x = A()
let y = A()

switch x {
    case y:
        break
    default:
        break
}

produces "error: expression pattern of type 'A' cannot match values of type 'A'".
This is kind of a vague description of what is really going on,
the compiler actually expects A to adopt Equatable protocol.

I'm using:
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9

I wasn't sure where to post this.
It would be nice if the error message could be improved to spare confusion for
the other developers.
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to