Skip to content

Commit 39e0a95

Browse files
huonwDougGregor
authored andcommitted
[stdlib] Make Optional, Array and Dictionary conditionally Equatable.
1 parent 44d8720 commit 39e0a95

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

stdlib/public/core/Arrays.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,7 @@ extension _ArrayBufferProtocol {
21872187

21882188
% for (Self, a_Self) in arrayTypes:
21892189

2190-
extension ${Self} where Element : Equatable {
2190+
extension ${Self} : Equatable where Element : Equatable {
21912191
/// Returns `true` if these arrays contain the same elements.
21922192
@_inlineable
21932193
public static func ==(lhs: ${Self}<Element>, rhs: ${Self}<Element>) -> Bool {

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2709,7 +2709,7 @@ extension Dictionary {
27092709
}
27102710
}
27112711

2712-
extension Dictionary where Value : Equatable {
2712+
extension Dictionary : Equatable where Value : Equatable {
27132713
@_inlineable // FIXME(sil-serialize-all)
27142714
public static func == (lhs: [Key : Value], rhs: [Key : Value]) -> Bool {
27152715
switch (lhs._variantBuffer, rhs._variantBuffer) {

stdlib/public/core/Optional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func _diagnoseUnexpectedNilOptional(_filenameStart: Builtin.RawPointer,
313313
line: UInt(_line))
314314
}
315315

316-
extension Optional where Wrapped : Equatable {
316+
extension Optional : Equatable where Wrapped : Equatable {
317317
/// Returns a Boolean value indicating whether two optional instances are
318318
/// equal.
319319
///

0 commit comments

Comments
 (0)