File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,8 @@ bool BindingSet::isDelayed() const {
150
150
bool BindingSet::involvesTypeVariables () const {
151
151
// This type variable always depends on a pack expansion variable
152
152
// which should be inferred first if possible.
153
- if (TypeVar->getImpl ().canBindToPack ())
153
+ if (TypeVar->getImpl ().getGenericParameter () &&
154
+ TypeVar->getImpl ().canBindToPack ())
154
155
return true ;
155
156
156
157
// This is effectively O(1) right now since bindings are re-computed
Original file line number Diff line number Diff line change @@ -718,3 +718,26 @@ func isHashable_is(_ error: Error) -> Bool {
718
718
func isHashable_composition( _ error: Error & AnyObject ) -> Bool {
719
719
error is AnyHashable // OK
720
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
+ }
You can’t perform that action at this time.
0 commit comments