Skip to content

Eliminate some unnecessary shadowing generic parameters #65982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/private/StdlibUnittest/MinimalTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public struct GenericMinimalHashableValue<Wrapped> : Equatable, Hashable {
self.identity = identity
}

public static func == <Wrapped>(
public static func ==(
lhs: GenericMinimalHashableValue<Wrapped>,
rhs: GenericMinimalHashableValue<Wrapped>
) -> Bool {
Expand Down Expand Up @@ -298,7 +298,7 @@ public class GenericMinimalHashableClass<Wrapped> : Equatable, Hashable {
self.identity = identity
}

public static func == <Wrapped>(
public static func ==(
lhs: GenericMinimalHashableClass<Wrapped>,
rhs: GenericMinimalHashableClass<Wrapped>
) -> Bool {
Expand Down
4 changes: 2 additions & 2 deletions stdlib/private/StdlibUnittest/StdlibUnittest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3479,11 +3479,11 @@ struct Pair<T : Comparable> : Comparable {
var first: T
var second: T

static func == <T>(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
static func ==(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
return lhs.first == rhs.first && lhs.second == rhs.second
}

static func < <T>(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
static func <(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
return [lhs.first, lhs.second].lexicographicallyPrecedes(
[rhs.first, rhs.second])
}
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/Diffing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ private func _myers<C,D>(
* necessary) is significantly less than the worst-case n² memory use of the
* descent algorithm.
*/
func _withContiguousStorage<C: Collection, R>(
for values: C,
_ body: (UnsafeBufferPointer<C.Element>) throws -> R
func _withContiguousStorage<Col: Collection, R>(
for values: Col,
_ body: (UnsafeBufferPointer<Col.Element>) throws -> R
) rethrows -> R {
if let result = try values.withContiguousStorageIfAvailable(body) { return result }
let array = ContiguousArray(values)
Expand Down