Skip to content

Commit

Permalink
add a comment referring to the SR-14665
Browse files Browse the repository at this point in the history
Reference to [SR-14665](apple/swift#57016) links to more explanation on why the manual `==` implemenatation is necessary.
  • Loading branch information
WowbaggersLiquidLunch committed Jun 4, 2022
1 parent 4d9783d commit c27b2bf
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -10,6 +10,7 @@

extension SymbolGraph.SemanticVersion: Comparable {
// Although `Comparable` inherits from `Equatable`, it does not provide a new default implementation of `==`, but instead uses `Equatable`'s default synthesised implementation. The compiler-synthesised `==`` is composed of [member-wise comparisons](https://github.com/apple/swift-evolution/blob/main/proposals/0185-synthesize-equatable-hashable.md#implementation-details), which leads to a false `false` when 2 semantic versions differ by only their build metadata identifiers, contradicting SemVer 2.0.0's [comparison rules](https://semver.org/#spec-item-10).
// [SR-14665](https://github.com/apple/swift/issues/57016)
/// Returns a Boolean value indicating whether two semantic versions are equal.
/// - Parameters:
/// - lhs: A semantic version to compare.
Expand Down

0 comments on commit c27b2bf

Please sign in to comment.