We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 878066b commit 5b5b3ddCopy full SHA for 5b5b3dd
test/Constraints/casts.swift
@@ -718,3 +718,26 @@ func isHashable_is(_ error: Error) -> Bool {
718
func isHashable_composition(_ error: Error & AnyObject) -> Bool {
719
error is AnyHashable // OK
720
}
721
+
722
+// rdar://109381194 - incorrect ambiguity while comparing collections
723
+do {
724
+ class A : Hashable, Equatable {
725
+ func hash(into hasher: inout Hasher) {
726
+ }
727
728
+ static func == (lhs: A, rhs: A) -> Bool {
729
+ false
730
731
732
733
+ class B : A {}
734
735
+ func test(a: [B], b: [String: B]) {
736
+ assert(Set(a) == Set(b.values.map { $0 as A })) // ok
737
738
739
+ func test(a: [A], b: [B]) {
740
+ assert(Set(a) == Set(b.map { $0 as A })) // Ok
741
+ assert(Set(b.map { $0 as A }) == Set(a)) // Ok
742
743
+}
0 commit comments