Commits

Joe Pamer committed e783ab1c0d3
Support equality comparisons between 'nil' and non-equatable optional types (rdar://problem/17489239) To facilitate the removal of the BooleanType conformance from Optional<T>, we'll first need to support equality comparisons between the 'nil' literal and optionals with non-equatable element types. We can accomplish this via three changes: - New overloads for "==" and "!=" that we can resolve against non-equatable optionals - A tweak to our overload resolution algorithm that, when all other aspects of two overloads are considered equal, would favor the overload with a more "constrained" type parameter. This allows us to avoid ambiguities between generic overloads that are distinct, but whose parameters do not share a pairwise subtype relationship. - A gross hack to favor overloads that do not require bindings to 'nil' when presented with an otherwise ambiguous set of solutions. (Essentially, in the face of a potential ambiguity, favor solutions that do not require bindings to _OptionalNilComparisonType over those that do.) The third change is only necessary because we currently lack the ability to specify "negative" or otherwise more expressive constraints, so we'll want to rethink the hack post-1.0. (I've filed rdar://problem/17769974 to cover its removal.) Swift SVN r20346