-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Fix conformance-related warnings appearing after PR85757 #86183
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
base: main
Are you sure you want to change the base?
Conversation
The conformances `Type: Comparable` and `EnumCase: Equatable` were previously introduced in swiftlang#85757 for implementing AutoDiff closure specialization logic. This patch moves the conformances directly to the SIL module to address warnings mentioned in the comment: swiftlang#85757 (comment)
|
@swift-ci Please test |
| hasher.combine(bridged.opaqueValue) | ||
| } | ||
|
|
||
| public static func < (lhs: Type, rhs: Type) -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very inefficient. It's better to compare the raw pointers of the bridged type.
For what reason do you need Type to be comparable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've introduced that to make test output more predictable when printing an array of types.
I've also just discovered that such a conformance is not required since we have an overload for sort which accepts the comparator function: https://developer.apple.com/documentation/swift/array/sort(by:)
So, I'll use that instead for ADCS tests and just delete this conformance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eeckstein See fix in 575333d
Update the PR description correspondingly
Type: Comparable and EnumCase: Equatable conformances|
@swift-ci Please test |
eeckstein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
The conformances
Type: ComparableandEnumCase: Equatablewere previously introduced in #85757 for implementing AutoDiff closure specialization logic. This patch moves the latter directly to the SIL module. The conformanceType: Comparableis deleted, andsort(by:)is used instead ofsortto mimic the same behavior in tests. These changes address warnings mentioned in the comment: #85757 (comment)